BBSysco development log 
Business Basic Systems Corporation

August 13, 2007

Memory Files

Filed under: General Design — Mike King @ 11:41 am

Have spent some time designing the internal layouts of a memory file equivalent for MSB.  Historically I have implemented these as binary searches on a sorted list of records.  While this provides for fast look-ups, WRITE require the list to be shuffled in order to add/remove entries from the list and this can be a fairly large overhead for large memory files.

What I think I’m going to do for MSB is implement the memory files as “symmetric binary trees” using the generic red-black algorithm which should provide for optimum access time while reducing the insertion/removal overhead.  I had considered a splay tree algorithm which works well if the data is being recalled often as it sorts the tree based on most recent access — however I think the red-black algorithm will be better.

I also will likely use this for ”string” based array sub-scripting that I am considering adding to MSB.  Although in this case a Splay tree might be better.

2 Comments »

  1. Does the “string-based array subscripting” you’re talking about is the equivalent of PHP “associative arrays” or PERL hash tables ? IE arrays that you access using some sort of string key (such as myTable[”myItem”]) ?
    If so that would be a very nice addition !!!

    Comment by Stéphane — August 13, 2007 @ 1:06 pm

  2. Yes Stéphane it does…

    Comment by Mike King — August 13, 2007 @ 1:20 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress