Maps vs. Objects in JavaScript (performance)

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

haven't seen many people compare their performance, quite insightful

gideonmaxmerling
Автор

In addition, an even more underutilized data structure is the *WeakMap*. It's very powerful if you don't want your map to prevent objects from getting GC'd, or for simply attaching your own data to existing objects.

DavidsKanal
Автор

Great video. I wish all educators used the large fonts and captions you used. Short and concise. Kudos.

vivekkaushik
Автор

never knew their was a difference. Thanks for the insight.

ibukunoyeniyi
Автор

Great comparison between Maps and Objects Andrej!

CreatorAmp
Автор

Nice video man, you got youself a new subscriber :))

josephx
Автор

Very useful information regarding using maps. Great tutorial brother

devashishrai
Автор

Amazing! Definitely learned something new today. Keep making these videos.

subho
Автор

Really liked this performance comparision between Map and Objects, Andrej 👍

codewithshripal
Автор

Great Comparison man! Hoping to see more from you

stevedevelops
Автор

Really cool video, I wish author had more of them!

andeevacik
Автор

One thing that would have been good to test is the performance if you only use symbols. Another thing that would be good to test is subsequent reads to see if the interpreter has done any caching.

soviut
Автор

Awesome video! Quick, concise, explains all the small nuances.
Looking forward to more :)

sabishiimono
Автор

I had a similar question recently, wondering if there's any advantage in the circumstance where there is a known schema (like a SQL table) to using an array of arrays vs an array of objects since the array of objects will have the schema repeated many times in the data whereas the array of arrays will not. I would think over the wire, you're saving on data transfer with the array of arrays.

noahwinslow
Автор

Only slight downside I've found with Maps is that they don't quite have the full "first class" support that Objects have. Allowing map["key"] to be the same as map.get('key') would be a subtle but big improvement, as would be supporting the in operator.

static-san
Автор

incorrect benchmark, but yes, map is better than object for storage
check how js engine optimize your code, you can find videos about that

snatvb
Автор

That's awesome!
Can i get your desktop background, please? 😊

ehmaedalhams
Автор

as a non js dev i am wondering why this is a commnon thing in js. i guess when dealing with json everything is an object by default, maybe that is where the semantics gets lost/overlooked. object vs collection is much more clear in other languages

animanaut
Автор

Thanks for the video, by the way I loved your colorscheme. Do you mind sharing its name?

MateusGamer
Автор

Wow, JavaScript just seems gross now im serving Rust REST APIs in 2ms.

NexusGamingRadical