theKashey / proxyequal

There is a bit more smart way to compare things, than a shallow equal.
MIT License
72 stars 7 forks source link

Avoid creating inline variables in escape key #28

Closed pie6k closed 4 years ago

pie6k commented 4 years ago

This function is called very often, so creating variables inside will lead to more garbage collections required

Also, probably regexps that are shared between comparisons might get optimized by JS engine, while inline regexp creates new 'instance' each time.

theKashey commented 4 years ago

https://jsperf.com/regexp-vs-compiled-regexp/1

pie6k commented 4 years ago

Thanks! Could you publish it to npm? :)

theKashey commented 4 years ago

v2.1.3 released!