Stuff was running unreasonably slow in perl blead. This commit tightens
things up. I used NYTProf to find the most-run, and most time consuming
Util::accessor generated accessors were #1, simply because they were
called so much, I was able to make a minor change that gave a huge
Builder::Trace was the next biggest offender, this was more complicated
1) Instead of tracing multiple times, ok, and similar functions locally
cache a trace to re-use if needed. This is by far the biggest
2) In an independant branch I worked on code to avoid 'building' a
trace until necessary. This means it simply grabs all the call stack,
and only calculates what must be done now (encoding, and todo).
Everything else is generated once needed, if at all. In most cases a
build only needs to happen during a test failure. This provided a big
boost, but not as big as #1.
Branches for #1 and #2 were combined and together provided extra
I also updated a couple places that used trace to simply look at caller
themselves, trace was overkill.
In 2 places Test::Builder does string evals to pretend to be the caller,
this is done to make sure warning go to the correct place, I updated
these to only build the trace if warnings actually occur.
All of this together resulted in huge improvements with the test script
I wrote for profiling.
Original run time: 160 seconds.
Final run time: 15 seconds.
The script was a loop that ran 1000 times running both passing and
failing tests using ok, like, is, is_deeply both inside and outside a
This still is longer than the Test::Builder before the alpha, which took
5 seconds, but I believe the added benefit from the alphas is worth