[ENH][REFACTORING] Re: Large integers
Bob Arning
arning at charm.net
Fri Aug 4 05:30:35 UTC 2000
On Fri, 04 Aug 2000 01:39:38 +0200 Helge Horch <Helge.Horch at munich.netsurf.de> wrote:
>I had to bump up the loop by a factor of
>10 to see a difference for small integers (which really aren't the point of
>the whole business):
>
>[1000 timesRepeat: [855 raisedTo: 2753 modulo: 3233]] timeToRun --> 40
>
>[1000 timesRepeat: [DigitalSignatureAlgorithm new raise: 855 to: 2753 mod:
>3233]] timeToRun --> 60
I would suggest an even larger iteration count - in 60 ms there could be an extra minor garbage collection or two that skewed the results. You are also losing a few ms to the instantiation of a DSA each time. The really finicky programmer would have one stashed in a global somewhere for instant reuse. ;-)
>And, just to round it up with numbers comparable to those posted before,
>the DSA #timeDecode: test using Jesse's code and the simplified #\\\
>lingers around 7,290 to 8,492 ms. After replacing #\\ with #\\\ in Jesse's
>code (which I think is reasonable), I finally reach the former region of
>5,789 to 6,960 ms.
>
>Should we thus
>
>1/ include Integer>>\\\,
>2/ include Jesse's slightly modified Integer>>raisedTo:modulo:,
>3/ drop DSA>>raise:to:mod:
>4/ let DSA use Integer>>raisedTo:modulo:
>
>as per the attached changeset? Gives us generality, a better-located
>method, and doesn't significantly harm performance.
Sounds OK to me.
Cheers,
Bob
More information about the Squeak-dev
mailing list
|