Thursday, May 30, 2013

Parallel xasc

Sorting a table can be divided into two parts: determining the new order for the rows, and applying that ordering to the columns. While the former can’t be parallelized in q, the latter can. I don’t have any hard numbers handy at the moment, but with large tables and under the right conditions, I’ve seen noticeable speedups.

Note, BTW, that you can’t (and shouldn’t) write to disk from inside a peach, so this is only applicable to an ordinary in-memory table sort, not the on-disk variety (`c xasc`:t).

q)pxasc :{(count keys y)!flip{y x}[ iasc(raze x)#0!y]peach flip 0!y}
q)pxdesc:{(count keys y)!flip{y x}[idesc(raze x)#0!y]peach flip 0!y}

Labels:

2 Comments:

At August 25, 2015 at 12:05 AM , Blogger Arif Hossain said...

This comment has been removed by the author.

 
At July 17, 2019 at 7:05 PM , Blogger madin said...

De winkel heeft problemen voor mij opgelost,goedkoop nike schoenen de service is zeer geduldig, dit is een perfecte winkelervaring. Toen ik de schoenen ontving, vond ik het een goede kopie van de schoenen. Ik vind deze online winkel leuk,goedkoopnike air max 270 deze schoen is eenvoudig en genereus. Zeer tevreden met deze aankoop.

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home