Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Simple date and time manipulation

by Corion (Patriarch)
on Jan 19, 2011 at 13:43 UTC ( [id://883123]=note: print w/replies, xml ) Need Help??


in reply to Re: Simple date and time manipulation
in thread Simple date and time manipulation

To expand a bit on BrowserUk's terse reply:

Our target is to execute 1 billion such calculations in one second.

Let's assume that "the CPU" can execute 1 date/time calculation per time step.

We will need to execute 1 billion CPU time steps within one second. That is 1_000_000_000_000 time steps per second (burst, not sustained, mind you). So our CPU needs to run at 1000 GHz to meet that, never mind the overhead of fetching/storing the program or results.

As 1000 GHz is still three magnitudes away and chip makers seem to have given up on the race of raw GHz, likely due to physical limits, maybe we can assume that "the CPU" has more than one core. "Mainline" CPUs (AMD or Intel) have something like 8 or 16 execution units per die, so these would need to run at 1000/16 GHz, still a bit far off. GPUs, albeit very specialized vector machines, are claimed to have "up to 512" CPUs (well, stream processors) in their marketing brochures (NVidia Geforce 500), but they only run at 750 MHz, or only 75% of what we need to come close to that claim.

If you look at these numbers, and the simplifications I've made, I think you'll concede that your formulation of "one billion date/time calculations in far less than one second" is still a bit away in the future.

Replies are listed 'Best First'.
Re^3: Simple date and time manipulation
by BrowserUk (Patriarch) on Jan 19, 2011 at 14:07 UTC

    Indeed. And that's if you wrote in machine code.

    But my proof is a little simpler, and more germane to the OPs situation. 10e7 takes three seconds, and that's just returning a constant, albeit not an optimised away one.

    C:\test>perl -MTime::HiRes=time -E"sub t{1}; $t=time; $x=t()for 1..1e7; printf qq[%f\n], time()-$t" 3.305000

    Not hard to verify.


    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".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

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

    No recent polls found