[ENH] IntegerPrintOpt-gk

ducasse ducasse at iam.unibe.ch
Tue Nov 25 17:36:14 UTC 2003


On Mardi, nov 25, 2003, at 18:11 Europe/Zurich, 
goran.krampe at bluefish.se wrote:

> from preamble:
>
> "Change Set:		IntegerPrintOpt-gk
> Date:			25 November 2003
> Author:			Göran Krampe
>
> Improvement of Integer>>printOn:base: spurred by results comparing
> SharpSmallalk with Squeak. I have borrowed John's implementation and
> merged it with the old one.
>
> It is about up to 3 times faster than the old code.

john is cool and excellent. This is why we are pushing RB AST, parser, 
scanner in Squeak.
Thanks john, marcus and anthony for that.

Stef

>
> Read method comments, printOn2:base: is the one recommended for
> inclusion.
>
> Some test code, use print-it (third one is my recommendation):
>
> b _ 1000 factorial.
> a _ (1 to: 10) collect: [:i | b].
> {Time millisecondsToRun: [
> 	String streamContents: [:str | a do: [:aa | aa printOn: str base:
> 10]]].
> Time millisecondsToRun: [
> 	String streamContents: [:str | a do: [:aa | aa  printOn1: str base:
> 10]]].
> Time millisecondsToRun: [
> 	String streamContents: [:str | a do: [:aa | aa  printOn2: str base:
> 10]]].
> Time millisecondsToRun: [
> 	String streamContents: [:str | a do: [:aa | aa  printOn3: str base:
> 10]]]}"!
> <IntegerPrintOpt-gk.cs.gz>




More information about the Squeak-dev mailing list