SQLite offers through its JSON1 extension a lot of capability. Generating JSON outputs from SQL, even complex structured, multi-level JSON is very straightforward.
But what about the opposite use case ? When you have store data as JSON in an SQLite database, and you want to search or filter it ? This is a short exploration of what to expect.
Hash, IndexOf, Lookup, Performance, Search, Sorted, StringAs a followup to the previous String Lookup: Hash, Sorted or Unsorted here is a look at what happens for longer strings.
When the string you’re searching have more than a dozen characters, and you only have a few hundreds of them, a clear winner emerges.
When looking up a string, what is the fastest strategy?
A hash map, a sorted list or an unsorted list?
Of course it depends on how many strings you have, but where are the cutoff points?
Here is a quick test, and an interesting tidbit is uncovered…
How fast are mobile CPUs these days? Well, they are pretty fast processors.
While some still consider that x86 is ten times faster than ARM, that is just not the case anymore these days, the difference is much smaller, and closer to just two times if you compare a regular smartphone to a regular laptop/desktop.