Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Reduce CPU utilization time in reading file using perl

by Laurent_R (Priest)
on Sep 28, 2013 at 14:35 UTC ( #1056138=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Reduce CPU utilization time in reading file using perl
in thread Reduce CPU utilization time in reading file using perl

Hi, my question was: how many CPUs/cores (not just CPUs) do you have. Even if you have only one (e.g. Intel) CPU, but with, say, five cores, your process might very well take more or less 100% of one core's processing power but still leave the 4 other cores almost completely idle. Since you are not forking subprocesses in your program nor using any threads, your process can basically only use one core (the system itself might be able to delegate a small fraction of its own work to another core, but this is likely to be very limited). So you might very well use 100% of one core's processing power, but only 20 or 25% of the CPU total processing power.


Comment on Re^3: Reduce CPU utilization time in reading file using perl
Re^4: Reduce CPU utilization time in reading file using perl
by madtoperl (Monk) on Sep 30, 2013 at 06:43 UTC
    Hi Laurent R
    Thanks a lot for your clarification. My CPU is 4 core so it looks like only 1 core is used for this process and that is why it is showing around 23% out of total 100% capacity of the CPU. I need to read two large files and find the difference based on column and store the differnces in the third file. Can I use threads here to read this huge file and store it into a hash. Or is there there any other better way to handle this. Please suggest.
    Thanks
    madtoperl

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2014-04-23 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (551 votes), past polls