-
Notifications
You must be signed in to change notification settings - Fork 578
Bug report: study on lexicals seems broken #4024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From [email protected]'study' on a lexical variable doesn't work as desired. First benchmark: with my-variable (with/without study): with: 31 wallclock secs (31.19 usr + 0.00 sys = 31.19 CPU) @ 1.89/s (n=59) The version with study runs SLOWER. Second benchmark: same code but variable is global: with: 31 wallclock secs (31.36 usr + 0.00 sys = 31.36 CPU) @ 3.70/s (n=116) The version with study a FASTER (as it should - for 3013 m//'s per study). In a third benchmark I wanted to study a totally unrelated and nonexistant Use of uninitialized value in study at ... So it looks like study IS studying the lexical (and not some global with the Forth benchmark: same code as third but the global was initialized to ''. with: 31 wallclock secs (30.87 usr + 0.00 sys = 30.87 CPU) @ 1.17/s (n=36) ?An even bigger slowdown? From studying a variable that only contains an empty PS: This is the benchmarked sub: $s1 = undef; $s2 = ''; $html = html-version of Benchmark POD :-); sub with { PPS: I thought this were a documentation problem - until the third Perl Info
|
From @simoncozens You may have only one study active at a time -- if you study a |
From [Unknown Contact. See original ticket]
He's saying, "on runs 1 and 2, I did 'study $s'. on run 3, I did 'study |
From @rspierHe has a function that looks something like this: sub foo { /regexp/; } And then he's calling that function: So Simon's statement is right. In 'foo', only $s2 is effectively -R Jeff Pinyan writes:
|
From @vanstyn:PS: This is the benchmarked sub: Without the complete code you used for the benchmarking, it is difficult These are the results I get with the code below, which show study giving Benchmark: timing 10 iterations Hope this helps, Hugo #!/usr/bin/perl -w $run = q{ use Benchmark; |
From [Unknown Contact. See original ticket]
You're right. I didn't prepare one test with 8 funktions - I did 4 (ok, so the code was: 1.a) my $s ... study $s and of cause there was more code around this snippet... Short summary: Speed of m//atch on lexical without study and global without study is same. cu |
1 similar comment
From [Unknown Contact. See original ticket]
You're right. I didn't prepare one test with 8 funktions - I did 4 (ok, so the code was: 1.a) my $s ... study $s and of cause there was more code around this snippet... Short summary: Speed of m//atch on lexical without study and global without study is same. cu |
Migrated from rt.perl.org#7034 (status was 'resolved')
Searchable as RT7034$
The text was updated successfully, but these errors were encountered: