telash – 21-49 Sep 4

Say my db is one big json, with 1m objects.

What is better for efficiency - keeping it an array of objects, or using a Map to easily access objects with a long human readable string as an index, such as a url?

If Map isnt better, why? The string gets converted to many numbers behind the scenes, and not directly to a number that represent the place of that object in the array?
Was this page helpful?