Closed soffes closed 8 years ago
@soffes I like the delimiter between each component so that we can use String#split
, which is significantly faster than String#match
:
https://gist.github.com/jclem/e85a026c6d9dde57ba273f3a12d95123
I realize we could slice(2)
, then split(SEPARATOR)
, but I'd rather be able to just split(SEPARATOR)
. Doing slice(2); split(SEPARATOR)
is also significantly slower than both String#match
and String#split
. Obviously, these benchmarks for for JavaScript, but I'd be surprised if they differed much in other runtimes, as far as perf ranking is concerned.
Since we have a two letter name, delimiter, and then metadata, we can either use the full name or remove the starting delimiter:
or
Since we know the key will be 2 characters, having the starting delimiter is not necessary.