in reply to Re^8: Producing a list of offsets efficiently
in thread Producing a list of offsets efficiently
The two-level index should work. The overhead of accessing it indirectly may lose the benefits of avoiding reallocations.
When it comes to strings, I was thinking something simpler. Use 4 bytes per offset. Pack each offset into those 4 bytes. Sure, you can save more memory, but see if the simple approach is a big enough win. (It certainly should take less code, and makes it easy to access the 432343rd offset - depending on what you do this could be a big win.)
Personally I'd avoid all of these approachs unless I knew that the naive approach had serious problems for my dataset. (Yes, you've indicated why you think that it may for you. This is a reminder for anyone else who might be reading this thread.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Producing a list of offsets efficiently
by BrowserUk (Patriarch) on May 30, 2005 at 08:11 UTC |