perldlpp.pl doesn't do the Filter::Simple filtering, just classic...
On 2/25/2015 19:32, Derek Lamb wrote:
Pre-compiling my module into a .pmc file with perldlpp.pl reduces the
load time to about 9 seconds.
Additionally, pre-compling Graphics/PGPLOT/Window.pm into a .pmc
further reduces my module's load time to about 5 seconds. Still not
700ms, but getting there I guess. Have not don
The code is not available for release, yet. But you can get the gist
of the problem by doing this in the top-level PDL directory:
$ perl -d:NYTProf -Mblib t/niceslice.t
$ nytprofhtml
and then open nytprof/index.html
The load time isn't large for that file, but in the flame graph you
can see how most of the time (~75%) is spent in
Text::Balanced::extract_multiple. In my module it's more like 90%
just to load the module and execute '1;'
The issues reported below should be working with the Filter::Simple engine.
Getting the correct code into the runtime processing together with the
pre-compiling is needed.
Correctness: seems to be mostly OK, but a few places where the current
implementation misses:
1) scalar variable before a parenthesis inside a string:
die "thrDetLo element $_ (" . $lothreshes[$_] . ") is not <= thrDetHi";
gets translated as
die "thrDetLo element $_ ->slice(" . $lothreshes[$_] . ") is not <=
thrDetHi";
2) code in #commented-out (portions of) lines
3) POD (in Graphics/PGPLOT/Window.pm)
Usage: points ( [$x,] $y, [$symbol(s)], [$opt] )
gets translated as
Usage: points ( [$x,] $y, [$symbol->slice(s)], [$opt] )
Oddly, once I compile Window.pm into a .pmc I get no warnings and no
syntax error at line 2693, even though that line has not been touched
by the source filter. So I'm not sure what's going on there. Ideas?
You say you are down to 9 seconds in your pre-compiled code.
I'm assuming the 'use PDL::NiceSlice;" line(s) in your code
have been commented out?
If the files in the PDL core use-ing PDL::NiceSlice are
precompiled, then the load time should be back to the
original performance or better (since the sourcefilter
is not running every time the modules are loaded).
best,
Derek
On Feb 25, 2015, at 2:37 PM, Chris Marshall <devel.chm...@gmail.com
<mailto:devel.chm...@gmail.com>> wrote:
Derek, is the 0.7sec->13sec trouble module code you can share?
Regardless, any PDL::NiceSlice for our official release should not
have performance issues like that.
--Chris
On Wed, Feb 25, 2015 at 4:34 PM, Chris Marshall
<devel.chm...@gmail.com <mailto:devel.chm...@gmail.com>>wrote:
Hi Karl-
As I mentioned the current setting is to test/exercise/debug
the more correct parsing to not apply the PDL::NiceSlice
filter to the content of POD, comments, or string bodies.
Even so, you can set the PDL_NICESLICE_ENGINE environment
variable to 'Filter::Util::Call' to have the original fast, in-exact
processing with the current CPAN devel release.
--Chris
On Wed, Feb 25, 2015 at 4:24 PM, Karl Glazebrook
<karlglazebr...@mac.com <mailto:karlglazebr...@mac.com>> wrote:
I would say there is no excuse for 13 seconds!
- Karl
On 26 Feb 2015, at 8:01 am, Chris Marshall
<devel.chm...@gmail.com <mailto:devel.chm...@gmail.com>> wrote:
Hi Derek-
The current setting for the PDL::NiceSlice engine is
for checking that the implementation works. I appreciate
the problem report. I'm not able to directly check since
I can no longer build pgplot on cygwin so I don't have
PGPLOT either.
The performance difference with the new NiceSlice engine
is due to the fact that it is unoptimized in that it
preprocesses the entire file before applying the souce
filter where needed.
...snip...
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel