|
|
|
|
|
by QuadrupleA
2306 days ago
|
|
Cool learning exercise and fun read. Can't help but think SQLite could do this screamingly fast and very easily, with nice compact storage (blob primary key with the hashes, without-rowid table to avoid a hidden integer per row). That said, 49us is very impressive. Hard to beat low level custom coded solutions. |
|
Challenge accepted!
I used the following in q to download and load the data into a disk object I could mmap quickly:
This took about an hour to download, an hour to 7z|cut|xxd, and about 40 minutes to bake. At complete, I have an on-disk artefact in kdb's native format. I can load it: and I can try to query it: Now that's 1000 runs taking sum 5msec, or 5µsec average lookup time! It's entirely possible my MacBook Air is substantially faster than the authors' machine, but I think being ten times slower than an "interpreted language" suggests there's a lot of room to improve!