Hacker News new | ask | show | jobs
by andrewstuart2 4150 days ago
Use hash tables, hash maps, dictionaries, JavaScript objects, etc. (whatever it's called in your language of choice) for indexing.

This gives you constant time access to data by whatever properties you want to index on (usually by id).

Also, use libraries and reuse your own code/routines. If you find a faster way to do something, all the code that used those routines will benefit immediately.

1 comments

Corollary - some times hash tables aren't the fastest data structure. You can often replace a hash with a trie to see a considerable improvement (Caveat emptor ...)