Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/28/00 14:16
Read: times


 
#3465 - Move Pointers, Not Data
Of course there is the old computer science saying, "Move pointers, not data".

Ask yourself whether you really require a cut and paste pretty image of consecutive RAM data or whether you can use a pointer structure to keep the data where it is and merely change the threading?

OLD HISTORY FOLLOWS, NO NEED TO READ ON:
========================================
An example: Back in 1985 I did a records sorting and routing system that was an upgrade from one done a few years earlier for a different branch. The old source code did only one thing smart, it used a heap-sort algorithm as the core for organizing data.

However the previous programmer spent all his time moving long records around, back and forth as the sorting algorithm "cooked". To make matters worse, as he scanned a record for matches or magnitude, he spent a lot of his time moving through leading fields where records tended to match. It was very inefficient.

Judging from the overall caliber of work, which I threw away and rewrote, the only reason he had switched to a smart algorithm like heap-sort is that his coding implementation was just too slow (his ran on a 2Mhz Z-80).

When I coded this section I changed two main things. First I NEVER moved the data records during the sort, I only moved a linked list structure (So I only had to swap 16 bit pointers). Then to allow quick recognition (had to find records quickly as they moved at 100 ft per second) I prefixed each record with a hashing code derived from the record contents. With this I was able to skip quickly past similar records at the very first byte comparison (rather than traversing several fields before finding a dissimilarity).

I met the previous programmer years later at DSC Communications. He was telling me about this great system he had designed once, and I kept my month shut about how only a few years later I had gone in and tossed half his circuitry, fixed his extended bus link, re-written all his controller programs and radically improved his man-machine-interface.

-Jay C. Box


List of 6 messages in thread
TopicAuthorDate
Fast xram copy            01/01/70 00:00      
RE: Fast xram copy            01/01/70 00:00      
RE: Fast xram copy            01/01/70 00:00      
RE: Fast xram copy            01/01/70 00:00      
Move Pointers, Not Data            01/01/70 00:00      
RE: Move Pointers, Not Data            01/01/70 00:00      

Back to Subject List