shadowox8 / ku-latin

Tools written for the University of Kansas Department of Classics to assist in the teaching / learning of Latin.
GNU General Public License v3.0
0 stars 0 forks source link

SQL select vs. array loop performance? #2

Open shadowox8 opened 8 years ago

shadowox8 commented 8 years ago

The dataset is probably small enough that it does not matter much, but is there a significant efficiency difference between an SQL select statement and looping through an array of Verb objects to select all that match given chapter or conjugation parameters?

shadowox8 commented 8 years ago

Not that this answers the question, but Array.filter() should make programming easier.

Proof of concept: https://jsfiddle.net/shadowox8/sra5u6yy/2/

shadowox8 commented 8 years ago

Also, if we use an array, won't we have to generate that array every time someone loads the page? It probably will not be a pragmatic concern since the dataset will be so small, but damnit it's wasteful.