#2: How big is "the whole code"? I'm curious about what eval() and evalTree() do. When you say this sub has 95% of the runtime is that inclusive of these sub-calls or exclusive? If it's inclusive then your problem could very well actually be due to what happens in them...
UPDATE: Looking closer, I'm really curious about that eval() call. As it's written it doesn't make sense - Perl won't let you call a builtin with that syntax:
$ perl -e 'eval->(print "foo\n")' foo Undefined subroutine &main:: called at -e line 1.
That made me think you must not be using the real Perl eval() builtin. But now I wonder if you made a typo and your code actually is using the eval() builtin. If that's the case then you can stop searching, I know exactly why your code is so slow! String eval() is very slow in Perl - it's actually compiling your code each time it's run!
UPDATE 2: My mistake, Perl is apparently ok with that syntax for calling string eval():
$ perl -e 'eval->(qq{print "foo\n"})' foo
-sam
In reply to Re: optimization help
by samtregar
in thread optimization help
by GSF
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |