Yes - however actually that's what Espruino does internally for maps anyway (an O(n) search) - so if you implemented Map that way it wouldn't be the end of the world. Not great I know but I figured most objects/maps will be <10 items, in which case the overhead of just doing a very fast compare is much lower than that of having something like a red/black tree (especially as built-in object lookups are handled with a binary search).
If you're wondering it's on the issue tracker as something to look at - obviously it's more of an issue the more RAM you have available :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes - however actually that's what Espruino does internally for maps anyway (an
O(n)
search) - so if you implementedMap
that way it wouldn't be the end of the world. Not great I know but I figured most objects/maps will be <10 items, in which case the overhead of just doing a very fast compare is much lower than that of having something like a red/black tree (especially as built-in object lookups are handled with a binary search).If you're wondering it's on the issue tracker as something to look at - obviously it's more of an issue the more RAM you have available :)