Klebert-Engineering / simfil

The Simple Map Filter Language Interpreter 🌳.
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

Evaluate performance impact of sorting Object fields #43

Open josephbirkner opened 1 year ago

josephbirkner commented 1 year ago

Currently, the performance of ModelNode::get() is always O(N), with N being the number of object keys. We can change this to O(log N) for Objects by sorting the Object fields array by the field name key. Note, that this will not mean that object fields will appear in alphabetical order. The keys will be sorted in the order in which they were added to the Field name cache, which should usually coincide with desired display order.