Who wrote the script that uses a threaded factorial to test the speed of a processor?

Posted:
in Current Mac Hardware edited January 2014
Who wrote the script that uses a threaded factorial to test the speed of a processor? I can't find the thread were I posted in it. The script would do some math and would test the speed of current processors. Everyone was posting some benchmarks off their systems.



Which one of you sneaky nerds did it so I can find it again?



Is it me or is the search feature on this site not seeming to work correctly? I can't put my finger on it but something doesn't seem right with it.

Comments

  • Reply 1 of 19
    lundylundy Posts: 4,466member
    I wrote it. It's been a while since I ran it so I hope this is the right version.



    Try this: right click and download linked file, then unzip if needed



    http://www.johnnylundy.com/threadedFactorial.c.zip
  • Reply 2 of 19
    aplnubaplnub Posts: 2,605member
    Thanks! I will yet the download when I get back in the office. I am going to run it on my new duo mini and post back the results.



    Now if I could just find the original thread...
  • Reply 3 of 19
    aplnubaplnub Posts: 2,605member
    Quote:

    Originally posted by lundy

    I wrote it. It's been a while since I ran it so I hope this is the right version.



    Try this: right click and download linked file, then unzip if needed



    http://www.johnnylundy.com/threadedFactorial.c.zip




    I can download the zip file, then unzip it, but it opens with Text Edit. Any suggestions?
  • Reply 4 of 19
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by aplnub

    I can download the zip file, then unzip it, but it opens with Text Edit. Any suggestions?



    You need to compile it.



    For simplicity, put the file on your desktop. Then, in Terminal,



    cd ~/Desktop

    gcc threadedFactorial.c





    then when it is finished compiling, the file "a.out" on the desktop is the executable. So we have to set its executable flag to make it executable and then execute it (you can rename it to anything you want BTW)



    chmod +x a.out

    ./a.out



    the "./" (dot-slash, where SlashDot got its name) is the command to execute a binary file.



    I left it uncompiled because of the different computers people have. I have NOT tried compiling it for Intel - it should work fine but I don't know if you have to tell the gcc compiler something special.
  • Reply 5 of 19
    aplnubaplnub Posts: 2,605member
    When I do the ggc threadedfactorial.c I get the following:



    aplnub-iMac-G5:~/desktop aplnub$ gcc threadedFactorial.c

    -bash: gcc: command not found
  • Reply 6 of 19
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by aplnub

    When I do the ggc threadedfactorial.c I get the following:



    aplnub-iMac-G5:~/desktop aplnub$ gcc threadedFactorial.c

    -bash: gcc: command not found




    OK you don't have the Developer Tools installed.



    What happens when you say "cc" instead of "gcc"?
  • Reply 7 of 19
    aplnubaplnub Posts: 2,605member
    Same thing. command not found
  • Reply 8 of 19
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by aplnub

    Thanks! I will yet the download when I get back in the office. I am going to run it on my new duo mini and post back the results.



    Now if I could just find the original thread...




    I can't find the thread either. I am pretty sure the title was something like "Compute/Calculate 50 million factorials" and was over a year ago - it was a very popular thread.
  • Reply 9 of 19
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by aplnub

    Same thing. command not found



    Gimme a little time and I will compile a Universal Binary for you.



    Johnny
  • Reply 10 of 19
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by lundy

    Gimme a little time and I will compile a Universal Binary for you.



    Johnny




    OK - try this one, should be a Universal Binary



    http://www.johnnylundy.com/ThreadedFactorial.zip



    Unzip, do the chmod and then do the dot-slash on it.



    EDIT: Put the words "Threaded Factorial" in quotes, as the space between the words will confuse the BSD shell.
  • Reply 11 of 19
    aplnubaplnub Posts: 2,605member
    Quote:

    Originally posted by lundy

    OK - try this one, should be a Universal Binary



    http://www.johnnylundy.com/ThreadedFactorial.zip



    Unzip, do the chmod and then do the dot-slash on it.



    EDIT: Put the words "Threaded Factorial" in quotes, as the space between the words will confuse the BSD shell.




    it worked with no tinkering at all.





    Intel Mac Mini Core Duo - 3 seconds
  • Reply 12 of 19
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by aplnub

    it worked with no tinkering at all.





    Intel Mac Mini Core Duo - 3 seconds




    Dual 2.0 G5 (the original G5) takes 4 seconds. Core Duo wins.
  • Reply 13 of 19
    aplnubaplnub Posts: 2,605member
    Just think, that is only the 1.66 GHz core duo. Wowza!
  • Reply 14 of 19
    I got here after the original C file was removed (the link didn't work anyway). Could that program give a more accurate output of time. The two examples given (3 and 4 sec) could have been like 3.8 and 4.1 or so. So if you could modify it to output a more accurate measure.
  • Reply 15 of 19
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by macserverX

    I got here after the original C file was removed (the link didn't work anyway). Could that program give a more accurate output of time. The two examples given (3 and 4 sec) could have been like 3.8 and 4.1 or so. So if you could modify it to output a more accurate measure.



    You can just give it more iterations to do.



    the syntax is



    threadedFactorial cores iterations



    where cores is the number of processors and iterations is the iterations.



    if you omit both arguments, it defaults to the number of cores in the machine, and 50 million iterations.



    Examples of how to do 100 million and 200 million iterations on a Core Duo:



    ./"Threaded Factorial" 2 100000000

    ./"Threaded Factorial" 2 200000000



    etc.
  • Reply 16 of 19
    aplnubaplnub Posts: 2,605member
    iMac G5 1.8 GHz 20" 1st Gen. - 7 seconds
  • Reply 17 of 19
    iposteriposter Posts: 1,560member
    iMac G4 1Ghz



    27 seconds!!







    Any way to get this or something similar to work on an x86 for comparisons?
  • Reply 18 of 19
    chuckerchucker Posts: 5,089member
    Quote:

    Originally posted by iPoster

    iMac G4 1Ghz



    27 seconds!!



    iBook G3 700 MHz



    26 seconds



    You must have something CPU-intensive running in the background.
  • Reply 19 of 19
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by iPoster

    iMac G4 1Ghz



    27 seconds!!







    Any way to get this or something similar to work on an x86 for comparisons?




    It's a Universal Binary. It should work on the Intel Macs.



    It calls into BSD, so don't try it on a WIndows system.
Sign In or Register to comment.