Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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

by madtoperl (Pilgrim)
on Sep 28, 2013 at 13:21 UTC ( #1056132=note: print w/replies, xml ) Need Help??

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

Hi Laurent R<br. Thanks a lot. I have only one CPU. Why the CPU usage says 23% in one place and 100% in other place. Is my script the CPU's whole 100% while running my script or only 23% of the whole CPU's time. Could you please clarify.
  • Comment on Re^2: Reduce CPU utilization time in reading file using perl

Replies are listed 'Best First'.
Re^3: Reduce CPU utilization time in reading file using perl
by Laurent_R (Canon) on Sep 28, 2013 at 14:35 UTC

    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.

      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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056132]
[mark4]: Did activestate use to inclued teh perl packager, pp.exe in the standard distribution? I can't fine "pp.exe" anywhare.
[marto]: no
[marto]: that is to say, to the best of my knowledge, they never did.
[marto]: they have a commercial product called perlapp
[mark4]: Do you h=know how I can get pp.exe? Is there a module I can install that includes this?
[marto]: I always found Strawberry Perl on windows to be a much better environment, made life much easier

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2018-01-19 14:11 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (218 votes). Check out past polls.