Home > front end >  Compared with the map object properties
Compared with the map object properties

Time:11-04

The key for the string
Add operation: object performance overhead is about 1.5 times more than the map
Delete: the two basic consistent
Traversal: object cost is nearly 10 times the map

The key for integer
Add operation: the object is faster than the map slightly
Delete: object is faster than map, about 0.7 times
Traversal: object than the map slowly, about 1.5 times

Conclusion: try to use the map as a dictionary
  • Related