develooper Front page | perl.perl5.porters | Postings from June 2016

Script runs slower with better hardware

Thread Next
From:
David Emanuel da Costa Santiago
Date:
June 1, 2016 22:38
Subject:
Script runs slower with better hardware
Message ID:
20160602003829.029bb4d7@gmail.com


Hi!

The beginners mailing list recomended for me to send this email to the
p5p mailing list, since this is not a beginners issue :-)


I have a script that writes to a socket, but the same script have
diferent speeds on different machines. It's faster on my 5 year laptop
than on my recent desktop!

I profiled the script with NYTProf, on both machines and some functions
are taking almost the double of the time! Example of NYTProf output:

on my laptop:

Calls: 10631
Exclusive Time: 28.2s
Inclusive Time: 28.2s
Subroutine: Net::SSLeay::write_partial (xsub)

On my desktop:

Calls: 5057
Exclusive Time: 45.0s
Inclusive Time: 45.0s
Subroutine: Net::SSLeay::write_partial (xsub)

(This is where it's spending the most of the time, but it's not the
only function)

Please note the difference in the number of calls and the difference
in the time spent.

Both machines have the same software version (OS, perl, Net::SSLeay and
openssl) and the internet connection is the same. The hardware is
different.

What puzzles me is that my desktop have better hardware (according
to the benchmarks on the internet) than my old 5 year laptop. However i
get way worse speeds on my desktop.

On both machines, when the script is running the CPU is around 7%, and
the RAM usage is between 50MB - 100MB.

I can also reach full speed on both machines, using other application
(not in perl).

The question for one million dollar is "Why?". And how can i improve
the performance of my desktop to reach the same speed as my laptop
(considering that i have better hardware on my desktop)? 


Perl version: 5.22
Net::SSLeay version: 1.72
Openssl version: 1.0.2.h
OS: Archlinux up to date.
Laptop CPU: i7 Q 720
Desktop CPU: i5 6500T


Best regards,
David Santiago

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About