File Performance Q.?

Jimmie Houchin jhouchin at texoma.net
Sat May 11 05:53:22 UTC 2002


On Fri, 2002-05-10 at 15:07, Jimmie Houchin wrote:
[snip of original message]

Thanks to all who replied.

After I got home I copied my code into Python and Squeak with
appropriate platform directory modifications. And ran the tests again.

On WindowsME I got a 100:1 Squeak:Python ratio.
Not what I hoped for.

My initial tests for the same code on my Debian Linux (Sid) machine
running a 700mhz Athlon with 256mb ram.
File size 4960156

Python 2.1.x
1.948
1.967
1.058
1.078
1.069

Squeak 3.1current Unix VM with 3.2gamma4857 image
55272
55280
55610

Just with a different platform VM it went to a 
55:1 Squeak:Python ratio.

Then I went to work with your suggestions. Except I forgot to do a
messageTally. Sorry. :)

Here's the new Squeak code.
My apologies if there are any errors. I had to type it in. For some
reason I couldn't copy and paste from Squeak into Evolution.
I know, I'm not up to speed with Celeste yet. :(

|file1 file2|
Transcript show:
[file1 := StandardFileStream new.
file1 open: '/home/jimmie/test/testfile.txt' forWrite: false.
file1 := ReadStream on: file1 contentsOfEntireFile.
file1 reset.
file2 := StandardFileStream new.
file2 open: '/home/jimmie/test/testfile2.txt' forWrite: true.

[file1 atEnd] whileFalse:
[file2 nextPutAll: file1 nextLine; cr].

file2 flush.
file2 close.] timeToRun.

I am still using the 'file1 atEnd' as a condition for iteration. I
haven't figured out another way to iterate thru the file line by line.
Nevertheless here are my new Squeak results.

307
239
231
230
233

Making the new Squeak to Python ration 1:4 being generous. :)

I am much happier with these results.
While I am not confident of it being totally optimized, it is
tremendously better. I will try it again tomorrow on the Windows
machine.

Thanks again for everyone's help.

Next I'll try something more interesting, searching each line for
certain criteria and modifying certain lines.

Jimmie Houchin




More information about the Squeak-dev mailing list