Object System: New Data Structure

September 19, 2009 General News 0 Comments

A new data structure was conceived today. While GDS is very powerful, it's not very efficient, and code readability can become an issue when several structures are nested. It's difficult to retrieve multiple-nested variables because that requires first retrieving the nested structures sequentially, which can get annoying.

Object System, to be abbreviated OS, is designed to be a speedy and easy-to-use alternative to GDS. Syntax for OS is as follows:
// Initializing an OS structure and writing some variables
OS("myvar1=value!",OSstruct)
OS("myvar2=another value!",OSstruct)
OS("myvar3=a third value!",OSstruct)
OS("myvar1.substruct.nestedvar=a nested value!",OSstruct)

// Reading a variable
OS("myvar1.substruct.nestedvar",OSstruct)

As one can see, the syntax is very concise and designed to offer maximum code readability with minimum wasted coding time. Also, nested variables are as easy as using the typical object-oriented dot operator. Of course it isn't true "nesting," like GDS, but it still offers good readability.

Finally, the performance benefits of OS were measured against GDS to make sure that OS is more efficient. Though the graphs don't display much gain, the performance tests did NOT measure the access times on nested variables, which would have taken GDS MUCH longer to retrieve and OS would have pulled ahead significantly.

A graph of performance follows

I hope to redesign the fractal cutting engine soon with the help of OS.