Open xoliver opened 1 year ago
Hi! Thank you for the idea! But is it really more performant to run the big regex than to create an array of two strings? Any tests ?
Hi @houd1ni . Thanks for your comment. This is my thinking:
if
so it should be the same performance or very marginally betterI'm not a JS benchmarking expert (or JS experienced!) but I found this out and put out an example here, based on the input used in the unit tests: https://www.measurethat.net/Benchmarks/Show/27639/0/email-validator-pr-80-benchmark
My proposal seems to be 50% faster
Hi! I noticed that the regex already enforces that there should only be an
@
between two lumps of text, so an early check with the regex will: