Date: | Thu, 24 Mar 2005 12:43:15 +0000 |
From: | Michael Smith <smithm [...] gmail.com> |
To: | bug-Text-Context [...] rt.cpan.org |
Subject: | Performance probs with Text::Context |
Hello there,
Many thanks fo the work on Text::Context - it's really useful.
However I occasionally have some performance issues with it, that very
much seem to depend on the string that I'm producing a snippet from.
I attach an example with a string of only around 5K that takes 30 sec
on my (admittedly not very fast) server. Generally it produces the
snippet in a split second - so I guess there must be something in this
particular string.
The profiler gives the following output:
Total Elapsed Time = 31.13159 Seconds
User+System Time = 30.98159 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
77.3 23.95 23.955 467 0.0513 0.0513 Text::Context::EitherSide::as_spar
se_list
19.1 5.931 29.886 467 0.0127 0.0640 Text::Context::EitherSide::as_list
1.89 0.585 30.823 1 0.5853 30.823 Text::Context::Para::slim
0.90 0.279 30.157 467 0.0006 0.0646 Text::Context::EitherSide::as_stri
ng
0.23 0.070 0.065 467 0.0001 0.0001 Text::Context::EitherSide::new
0.23 0.070 0.148 6 0.0116 0.0247 Text::Context::Para::BEGIN
0.13 0.040 0.050 3 0.0133 0.0166 Text::Context::BEGIN
0.10 0.030 0.030 2 0.0150 0.0150 DynaLoader::BEGIN
0.10 0.030 30.238 467 0.0001 0.0647 Text::Context::EitherSide::get_con
text
0.06 0.020 0.019 6 0.0033 0.0032 Text::Context::EitherSide::BEGIN
0.03 0.010 0.010 1 0.0100 0.0100 warnings::BEGIN
0.03 0.010 0.010 5 0.0020 0.0020 vars::import
0.03 0.010 0.010 5 0.0020 0.0020 Exporter::import
0.03 0.010 0.010 2 0.0050 0.0050 Text::Context::_set_intersection
0.03 0.010 0.060 1 0.0100 0.0598 main::BEGIN
Any ideas as to what might be the issue with this particular string?
I'm continuing to look at it but any suggestions would be appreciated.
Many thanks
Michael Smith
Message body is not shown because sender requested not to inline it.