relative performance of two dimensional array and in-memory sqlite database
Dr. Hawkins
dochawk at gmail.com
Thu Jul 25 11:14:26 EDT 2013
Searching through the archives, I found what would have been my next
question. The answer being that using ":memory:" as the filename
opens an sqlite database in memory rather than disk.
That said, has anyone ever looked into the relative performance of
caching data into two-dimensional arrays, and into in-memory sqlite
when it comes time to search?
If I want to do something, say, for all the rows in which "squidget >
5", I could loop through ary[row][squidget] and check every one, or I
could "SELECT FROM table WHERE squidget>5 ORDER BY sqName".
It would seem to make sense that sqlite would be better optimized for
such things than a loop. (in fact, much of my data manipulation would
be easier in SQL with WHERE than in memory).
And, oh happy day, I actually wrote my code so that my data isn't
manipulated directly, but only through setVal and getVal(), so that I
can easily rip out and replace . . .
--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
More information about the use-livecode
mailing list