in reply to Re^2: [OT] A measure of 'sortedness'?
in thread [OT] A measure of 'sortedness'?
I know you said "call them numbers", but if they really are bytes of disk I/O data, the one-byte value range restriction does leave open the possibility of a very small index -- you could mark the first occurrence of each value in each of the buffers during the sequential scans.
Other metadata could be computed as well, if they will be revisited frequently, like run-length of a particular value.
During the merge operation, you might be able to speed up merge point decisions into what's left of the etherical 10% side buffer based on knowing where to go to get the next chunk of data that needs resequencing.
In fact, a run-length table in lieu of actual data might buy you the space you need for a one-pass optimization. Forget saving index offset. Save the value and the number of them. (WARNING: Corner case where lots of length < sizeof(integer) runs causes the working buffer to actually be larger than the source buffers should be considered.). Then just overwrite the buffer with the resulting data.
This would, of course, be an application-specific solution and not a general case proof for all airless merges, but sometimes that's the call the Engineer has to make.
Okay, I'm done spamming you for the moment and heading home. This one sounds basic but fun; I'll be following this thread closely.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: [OT] A measure of 'sortedness'?
by BrowserUk (Patriarch) on Mar 18, 2015 at 23:53 UTC | |
by marinersk (Priest) on Mar 19, 2015 at 00:31 UTC | |
by BrowserUk (Patriarch) on Mar 19, 2015 at 03:31 UTC | |
by marinersk (Priest) on Mar 19, 2015 at 15:18 UTC | |
by marinersk (Priest) on Mar 19, 2015 at 20:33 UTC | |
by BrowserUk (Patriarch) on Mar 19, 2015 at 21:46 UTC | |
|