[ENH] IntegerPrintOpt-gk
goran.krampe at bluefish.se
goran.krampe at bluefish.se
Tue Nov 25 17:11:53 UTC 2003
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.
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]]]}"!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IntegerPrintOpt-gk.cs.gz
Type: application/octet-stream
Size: 1535 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20031125/0eccf545/IntegerPrintOpt-gk.cs.obj
More information about the Squeak-dev
mailing list
|