On Wednesday, 14 May 2014 at 19:08:30 UTC, bearophile wrote:
You are good. Before this is ready for Walter's judgement I
think this needs some simple performance/memory benchmarks, to
compare the situation before and after this change.
I've made some minor optimizations, and rebased everything on
current master (both dmd and druntime).
Also here is a simple test i've run:
http://dpaste.dzfl.pl/f44762a17fe4
You-have-no-choice-but-pay-the-price-monitors:
max: 8709, min: 3227, average: 3484
Optional inlined monitor:
max: 12010, min: 5136, average: 5361
Optional missing monitor: no need to measure for obvious reasons.
So yeah, my monitors are like %50 slower, but
1. does it really matter?
2. i think further optimizations may be done here. The best way i
see it is to make _d_monitorenter/exit to be templates so that
monitored classes will be at least as fast as current monitors,
and even faster if _d_monitorenter/exit will be inlined. But
anyway such optimization may be done later if needed, without any
code breaking changes.