We don't bite newbies here... much | |
PerlMonks |
Re^2: get system info using perlby saurabh.hirani (Beadle) |
on Feb 05, 2009 at 16:00 UTC ( [id://741584]=note: print w/replies, xml ) | Need Help?? |
Thanks guys for your replies. I got a reply from comp.lang.perl.misc which pointed out the following 2 modules:
These modules really do pump up the speed from okay to burn-the-road. Just to compare system call and Filesys::Df, I wrote a small perl program which calls getting free disk using system call to df and using the module. I profiled them by running them around 1000 times and this was the output of dprofpp: Forking df and getting the time: Total Elapsed Time = 42.04899 Seconds User+System Time = 5.668994 Seconds Inclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 96.7 5.485 5.485 1000 0.0055 0.0055 main::get_freequeue Using df from the module Total Elapsed Time = 0.618107 Seconds User+System Time = 0.768107 Seconds Inclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 92.1 0.013 0.708 1000 0.0000 0.0007 main::get_freequeue 90.4 0.013 0.695 1000 0.0000 0.0007 Filesys::Df::df 88.7 0.682 0.682 1000 0.0007 0.0007 Filesys::Df::_df The difference is staggering. I will also play around with the IPC mod as pointed ou by zentara. Looks interesting
In Section
Seekers of Perl Wisdom
|
|