The BC_Hash class was 1 of the lion kingdom's very 1st C++ developments in 1997.  It was really a dictionary.  Lions had very little exposure to common data structures.  Sadly, lions weren't exposed to proper dictionaries until 2015.  Maybe it was an extremely lazy time or lions just spent a long time in assembly & C.

 There was a lot of resistance to the stdc++ library in the industry & a lot of alternative libraries like boost were favored.  Also, creating maps with any user defined class is hell.  That entails writing copy constructors, overloading all the standard operators.  It's very hard to debug operator overloading, hence why lions abandoned it.  The Arraylist did a lot of neat things the map class doesn't.  It protected against array overruns & deleted objects.  It was a lot more transparent about what it was doing.



BC_Hash was very primitive.  It didn't have a common key lookup function.  It replicated every single getter.  It had a separate load function for creating a new table & incrementally updating the existing table.  It was an optimization for the exponential growth of searching every past key.

1 thing it definitely needs is a way to look up the nth instance of a key instead of appending numbers to the keys.  The C++ multimap class solves all these problems & the modern usage just involves chatgpt searches.  Lions finally discovered the multimap from chatgpt.  When they 1st encountered it 20 years ago, it looked so complicated it was hardly worth using.

The multimap is greek compared to modern languages, with mnemonics like equal_range, first, second.  Suspect the next shoe to drop in language inventions is going to be auto.  Lions encountered auto back in 1997 but never bothered finding out what it actually does until 2019.  It's still a bit difficult to read code which doesn't specify the types.

Immediately noted multimap sorts the keys alphabetically when they're iterated.  Cinelerra saves a lot of blank key value pairs in its defaults so those all end up on top.

There's absolutely no observable speed difference between the multimap's binary searches & the iterating searches of the last 30 years.

1 thing that might be noticeable is if BC_Theme used maps.  Image lookups by text key are done a lot.

---------------------------------------------------------------------------------------------------------------------------------

Initial experiments in being able to interrupt a slow plugin were promising.  It should technically cause garbled output, memory leaks, & crashes because it leaves the plugin in an unknown state.  If the plugin doesn't use heap allocation or gets lucky, it could work.







Comments

Popular posts from this blog