You’ve profiled the right thing, but not looked at the correct output
from NYTProf. Namely, all this says is “7.24s were spent
in /REST/1.0/show”. You’ll need to drill down into there to find out
where the time is spent.
Since you’re looking for a regression, I suggest you profile both
4.2.10 and 4.2.9 (using the same steps you did above) and explore both
profile outputs in parallel, looking for where the extra 2.5s is coming
OK, I found the bad guy: w3m
As part of our RT 4.2.10 upgrade I installed HTML::FormatExternal.
So we use w3m for HTML2Text conversions.
NYTProf shows for 4.2.9 (core formater)
spent 141ms making 12 calls to
RT::Interface::ConvertHTMLToText, avg 11.7ms/call
and for 4.2.10 (w3m formater)
spent 10.1s making 12 calls to
RT::Interface::ConvertHTMLToText, avg 840ms/call
which is called in RT::Transaction->Content.
A quick test of the other formaters just confirms what is already
mentioned in the commit :
- core is the fastest (2.9s)
- elinks is the slowest (5.7s)
- the others are in between (4.6s)
So as long as you don’t find an reliable Perl HTML2Text converter, I
think there isn’t much we can do here.