[Gloucs] How much faster is assembly language

Tom Llewelyn tom at llewelyn.org
Mon Sep 19 17:13:58 UTC 2011


On 19 September 2011 17:41, Bob Wilkinson <rwilkinson at messagelabs.com>wrote:

> On Mon, Sep 19, 2011 at 03:02:09PM +0100, Gerd Busker wrote:
> > On 19/09/2011 14:52, Bob Wilkinson wrote:
> > >I decided to write some code to find out - and wrote up the results
> > >at http://www.fourtheye.org/armstrong.shtml
> >
> > Interesting.  Could you show us some results that have a bit more
> > calculation time in them?
> > Much of this could be due to the difference in startup time of e.g.
> > perl and something in assembly.
> >
> > Gerd.
>
> I extended the search space out by a further digit so we test
> numbers between 10 and 100000 (rather than 10000 as previously) and
> see...
>
> bob at poland:~/src/problems_for_computer_solution/07_armstrong_numbers$
> time perl armstrong_big.pl
>
> real    0m6.192s
>
> bob at poland:~/src/problems_for_computer_solution/07_armstrong_numbers$
> time ./armstrong_big_string
>
> real    0m3.303s
>
> bob at poland:~/src/problems_for_computer_solution/07_armstrong_numbers$
> time ./armstrong_big_macro
>
> real    0m0.044s
>

Those numbers are incredible!  I can understand that perl would be
relatively slow given that it's interpreted, but to have a fairly simple
looking bit of C code take 75 times as long?! Have you run a disassembler on
the C binary?

Tom


More information about the gloucs mailing list