Front page | perl.perl5.porters |
Postings from April 2012
[perl #9319] Perl bug -- split function
Thread Previous
|
Thread Next
From:
bulk 88 via RT
Date:
April 21, 2012 23:33
Subject:
[perl #9319] Perl bug -- split function
Message ID:
rt-3.6.HEAD-4610-1335076423-386.9319-15-0@perl.org
I thought a bit more. I dont have a Perl build with a C profiler
available, but I thought of NYTProf. But NYTProf doesn't profile all
opcodes, only select opcodes. The quadratic time, it might not be
pp_split to blame. It can be pp_padav or pp_aasign. NYTProf doesn't
provide opcode timings for all opcodes AFAIK. Someone correct me if I am
wrong.
Maybe pp_split should directly write into AVs targ style. But targ is a
Scalar not an Array. I'll throw it out, maybe that can change.
Made with Perl 5.12 and B Concise.
# 7: my $time1 = time;
8 <;> nextstate(main 408 n13.pl:7) v:*,&,{,$
9 <0> pushmark s
a <#> gv[*time] s
b <1> entersub[t5] sKS/TARG,3
c <0> padsv[$time1:408,412] sRM*/LVINTRO
d <2> sassign vKS/2
# 8: my @a = split //, $x;
e <;> nextstate(main 409 n13.pl:8) v:*,&,{,$
f <0> pushmark s
g </> pushre(/""/) s/64
h <0> padsv[$x:407,412] s
i <$> const[IV 0] s
j <@> split[t7] lK
k <0> pushmark s
l <0> padav[@a:409,412] lRM*/LVINTRO
m <2> aassign[t8] vKS
# 9: my $time2 = time;
n <;> nextstate(main 410 n13.pl:9) v:*,&,{,$
o <0> pushmark s
p <#> gv[*time] s
q <1> entersub[t11] sKS/TARG,3
r <0> padsv[$time2:410,412] sRM*/LVINTRO
s <2> sassign vKS/2
# 10: @a = ();
t <;> nextstate(main 411 n13.pl:10) v:*,&,{,$
u <0> pushmark s
v <0> pushmark s
w <0> padav[@a:409,412] lRM*
x <2> aassign[t12] vKS
# 11: my $time3 = time;
y <;> nextstate(main 411 n13.pl:11) v:*,&,{,$
z <0> pushmark s
10 <#> gv[*time] s
11 <1> entersub[t15] sKS/TARG,3
12 <0> padsv[$time3:411,412] sRM*/LVINTRO
13 <2> sassign vKS/2
# 13: printf("split and alloc: %6.1f\n", $time2-$time1);
14 <;> nextstate(main 412 n13.pl:13) v:*,&,{,$
15 <0> pushmark s
16 <$> const[PV "split and alloc: %6.1f\n"] s
17 <0> padsv[$time2:410,412] s
18 <0> padsv[$time1:408,412] s
19 <2> subtract[t17] sK/2
1a <@> prtf vK
---
via perlbug: queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=9319
Thread Previous
|
Thread Next