You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we iterate over JSON arrays by using a standard for-i-from-0-to-length loop. Then we index the JSON array by [i] syntax. Unfortunately, due to how JSMN structures are, the [i] lookup is O(n), so iteration is O(n^2).
We can instead use an iterator, which only requires a operator++ operation, which can be O(1) with the JSMN structures. This probably requires that array Jsmn::Object wrappers cache their end iterator.
The text was updated successfully, but these errors were encountered:
Fixed. An iterator is now available, which should lead to faster processing of JSON results. Not all possible use-cases have been changed to use iterators, but the heavy hogs (mostly channel finders) have been updated appropriately.
Currently, we iterate over JSON arrays by using a standard for-i-from-0-to-length loop. Then we index the JSON array by
[i]
syntax. Unfortunately, due to how JSMN structures are, the[i]
lookup is O(n), so iteration is O(n^2).We can instead use an iterator, which only requires a
operator++
operation, which can be O(1) with the JSMN structures. This probably requires that arrayJsmn::Object
wrappers cache their end iterator.The text was updated successfully, but these errors were encountered: