Different JS engines optimize different things using undocumented heuristics. If you hit a fast path on one engine and not another a speedup of 2-5x is normal. I've shuffled my code around to take advantage of these in the past and it's almost never worth it because the heuristics shift over time and the slow option becomes the fast option a year down the road. The main exceptions are writing your code so your variables don't change types and avoid changing the shape of your objects (hidden classes) since all the engines are tuned for these.
Also, those objects are on the small side so you might want to try benchmarking array_map instead of hash_map. Not sure if that'll make a difference but I *think* that's what the map literal would use for maps of this size. On Wed, Mar 12, 2014 at 5:14 AM, Leonardo Borges < [email protected]> wrote: > Hi all, > > Is there a mori mailing list? I'm happy to post this there if it does. > > I was doing some benchmarking on my Mac of a few simple operations > using lodah's cloneDeep function and mori. > > The results in Chrome were great. mori is only marginally slower than > the lowdash equivalent. > > When running the benchmark on Safari however things were *very* difference. > > First, for some reason, Safari is *way* faster than Chrome in my machine. > Secondly, mori's performance seems so be much worse in Safari. > > I might be missing something here but I was surprised by the results. > The benchmark is on jsperf: > http://jsperf.com/lodash-deep-cloning-vs-mori > > Any thoughts? > > Cheers, > Leonardo Borges > www.leonardoborges.com > > -- > Note that posts from new members are moderated - please be patient with > your first post. > --- > You received this message because you are subscribed to the Google Groups > "ClojureScript" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/clojurescript. > -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
