Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: Hypothesis: some magic string optimalization in perl kills my server from time to time

by leszekdubiel (Scribe)
on Sep 30, 2016 at 16:07 UTC ( [id://1173013]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Hypothesis: some magic string optimalization in perl kills my server from time to time
in thread Hypothesis: some magic string optimalization in perl kills my server from time to time

Here is the file -- 200 kilobytes (... small one):

download from Poland

download from we transfer

There is minimal test and description. Below is how I run tests. See -- one is half a seconds, and other is 20 seconds.

# ./show_me_the_problem.sh **************************** here are the two programs: -rwxr-xr-x 1 root root 177 wrz 30 17:57 run_fast.pl -rwxr-xr-x 1 root root 190 wrz 30 17:57 run_slow.pl **************************** the difference is: 10c10,11 < my $lst = list_extr(\( "(" . $inp . ")" )); --- > my $par = "(" . $inp . ")"; > my $lst = list_extr(\$par); **************************** data is the same... let's run them... time ./run_fast.pl | wc -l 9506 real 0m0.476s user 0m0.456s sys 0m0.016s **************************** time ./run_slow.pl | wc -l 9506 real 0m22.591s user 0m22.556s sys 0m0.012s **************************** seee... programs are almost the same... but their time is totally dife +erent

  • Comment on Re^4: Hypothesis: some magic string optimalization in perl kills my server from time to time
  • Download Code

Replies are listed 'Best First'.
Re^5: Hypothesis: some magic string optimalization in perl kills my server from time to time
by dave_the_m (Monsignor) on Oct 01, 2016 at 10:56 UTC
    I removed the no autovivification line from libr_data as I haven't got a perl to hand with that module installed, and both programs ran fast for me for all perls from 5.10.0 through 5.24.0. So that might be a thing for you to investigate first.

    Dave.

      Ditto. I couldn't reproduce the OP's timing differences, but I had also commented out no autovivification as I didn't have it (I cannot think why anyone would want it), and it didn't seem to stop the code from working.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.
      Ok! Thank you for checking. This has lead me to figure out that the problem exists only on currently stable distribution of Debian, while on newer software it runs as fast as expected. This is not a problem of autovivification. Tested on four of Debian installations. I will dig it deeper and maybe file a bug.
        Here is bug report: bug

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1173013]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found