in the mid 80's i ran into something similar. Fast is relative.<p>I had a lot of data, 640KB RAM, 64KB of heap, and 64KB of stack. I had hundreds of megabytes that I had to search extract data from and then combine some of them.<p>I experimented with data index structured into ternary trees. Conceptually it made sense, but implementation-wise the relationships and paths were still too big to keep in 64KB.<p>Instead of compression, I did swapping. I wrote a TSR (think service), a piece of code that would process a chunk of the data, extract the results, store it n the stack, dump the original data, make an interrupt call to the TSR, which in turn destroy the heap, and read in the next chunk from storage, return control to the program, process, combine with stack data, and continue until finished the entire process.<p>Originally this process took about a week for three data entry persons (think about a dozen 3" ring binders filled with tables), and an specialist combining the information. The program completed the work in just a few hours. It was amazingly "fast".<p>This was on a single threaded system.<p>[0] <a href="https://en.wikipedia.org/wiki/Terminate-and-stay-resident_program" rel="nofollow">https://en.wikipedia.org/wiki/Terminate-and-stay-resident_pr...</a>