stringer
stringer copied to clipboard
Make append! more aggressive
There are instances where append! emits unnecessary code which involves more work at run time that can be pushed to compile time.
In particular:
- stringable arguments can call toString at compile time and elide nil check
- expressions which aren't symbols, application or nil can elide nil checks
I tried running the benchmarks but results were a bit ambiguous, any way you think I can get higher fidelity results?
@bsless Thanks for the PR! One thing I generally tweak is the concurrency level, which can make the benchmark not be biased by the CPU cache coherence in absence of CPU scheduling across threads. Real life scenarios are generally highly concurrent with varying workload.
Example tweak:
CITIUS_CONCURRENCY=128 lein with-profile c10,perf do clean, test
Looking at the tests I'm not sure they can even give meaningful results if the symbols are bound in let forms anyway, I'll need to engineer another scenario. How do you feel about JMH?
JMH sounds like a good idea to me.
Starting a preliminary patch to add JMH