Sorry all should have added..
Have done the split on first field
($tag)=split (/\|/,$data,2);
as well as substr and index stuff
$tag=substr ($data,0,index($data,'\|',));
I then benchmarked them
Benchmark: timing 1000000 iterations of split, substr...
split: 8 wallclock secs ( 6.93 usr + 0.00 sys = 6.93 CPU) @ 14
+4279.32/s(n=1000000)
substr: 1 wallclock secs ( 1.54 usr + 0.00 sys = 1.54 CPU) @ 64
+8088.14/s(n=1000000)
should split be slow compared to substr?
Thinking about what i really want to know monks...
Once i ahve the first field is there a quick way of spliting this field on first space then on an undersocre (if it exsits)?
In my test file I have 5161033 lines, split slows down processing dramatically. When more substr are introduced processing slows down agian!
|