What is ....

Alma J Wetzker almaw
Thu Feb 9 16:31:20 PST 2006


Ben Duncan wrote:
> Ok, thanks everyone. The reason I asked is DBM stuff I am
> copying from, often to refer to bit-mappin' the index (WTFIT?) and
> using a bit-map for telling what "fields" are indices.
> 
> I can see the usage from when disk space was a premium (Kinda like the
> old COMP-3 stuff in Cobol), but as another question:
> 
> Now that we have HUGE disk drives, would it not be as feasible to simply
> use short unsigned int in an array configuration to do the same?
> 
> I am just looking to figure out the best way to:
> 
> A; Keep the code base maintainable by all walks of programming
>    Life Forms ( ;-> )
> B: Make it efficient and reasonably fast
> C: Apply the K.I.S.S. principal ...
> 
> 
> I already know that the SLAG DBM engine is going to have to be
> a B+tree ISAM type database, that it will have a limit of 32
> possible key fields per datafile  - One master, the rest secondary,
> ( If one needs MORE the 32, it is time to implement some sort of
> SQL !!! ), be of a multivalue , variable length record style.
> 
> 
> As Always:
> Any Comments, suggestions, critique are always welcome and
> sometimes appreciated ;-)

In a decade or more of business system programming, I used the bit 
mapping ability of C once.  I mapped Micro$oft Binary Format to IEEE 
Floating point Format.  They were close in data types, but the bit 
boundaries are different in the formats.  It was trivial to use a union 
to load the data, move the odd bits to a different location in a 
different union, and then access the floating point number normally. 
Reverse for the save and you are home free.  Not cheap or easy without 
bit fields.

I strongly believe that it is never too late to take code efficiency 
into account.  It is quite true that there is *LOTS* of storage real 
estate and memory range out there.  Does that mean that your program is 
obliged to use it all?  How about if you don't really need to with some 
thought?  I call that attitude the Micro$oft Syndrome.  It is not meant 
kindly.  Use what you need, save where you can.  Bits can be valuable.

     -- Alma


More information about the Linux-users mailing list