On Wed, Aug 12, 2009 at 7:00 AM, John Harrop<jharrop...@gmail.com> wrote:

> A very straightforward version, and 875.36796ms/100000000 = 8.7536796ns.
> This is on a 2.5GHz machine, so that's only about 22 native instructions per
> iteration. The theoretical minimum is over 1/2 of that:
> Four fmuls
> Three fadds and an fsub
> A floating point comparison
> An integer add and an integer comparison
> A branch back to the start of the loop
> So we're within a factor of 2 of *native* code speeds (nevermind Java) here.

It's not this straightforward. Superscalar CPUs handle multiple
instructions concurrently.

I can't give you concrete numbers on the paralellism of current processors,
but had a lot of fun trying to saturate both pipelines on my first Pentium,
writing i386 assembly ages ago.


Isak

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to