coercible
coercible copied to clipboard
Reduce usage of regexes for performance
Some small performance enhancements.
coercible at performance
branch:
Comparison:
Virtus: integer values for integer attributes : 20948.6 i/s
Virtus: string values for integer attributes : 18220.3 i/s - 1.15x slower
Virtus: string values for whatever attributes : 18067.7 i/s - 1.16x slower
Virtus: without values : 9618.0 i/s - 2.18x slower
coercible at master
branch:
Comparison:
Virtus: integer values for integer attributes : 21541.2 i/s
Virtus: string values for whatever attributes : 13354.4 i/s - 1.61x slower
Virtus: without values : 10314.2 i/s - 2.09x slower
Virtus: string values for integer attributes : 3165.7 i/s - 6.80x slower
- [x] Specs pass
Finished in 0.28534 seconds
396 examples, 0 failures
Benchmark code at: https://gist.github.com/tb0yd/79bc56683748605cff96
This benchmark is very simple & does not represent a realistic usage of Virtus. But the numbers are encouraging
Thanks, I'm gonna update and cleanup devel/test setup so that build is passing in master, then could you merge master into your branch and then I could merge it, OK?
Ok
OK, I updated master
BTW you could also check out another PR (that I must've missed for some reason :() that's related to performance
I couldn't reproduce his findings