aurelia / templating-binding

An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.
MIT License
32 stars 26 forks source link

perf(AttributeMap): use non-capturing regex group #107

Closed bigopon closed 7 years ago

bigopon commented 7 years ago

Hi, from this Benchmark https://gist.run/?id=b06f276129f58ec3422e8886cddb9af4

Changing

if (/(^data-)|(^aria-)|:/.test(attributeName))

to

if (/(?:^data-)|(?:^aria-)|:/.test(attributeName))

could improve performance for around 20+%. But I'm not sure if micro opts like this are needed. Please close if not necessary.

jdanyow commented 7 years ago

Every little bit counts, especially in this package. We'll merge things like this all day long! Great PR!