[Newbies] Speed

Herbert König herbertkoenig at gmx.net
Sun Nov 15 12:34:49 UTC 2009


Hi John,

JW> So are you saying that my example is slow because of the time
JW> taken to process the text data files in Squeak? (I was using 3.10)

definitely, 90% of the time is spent in MultiByteFileStream>>upTo
which is sent in WebLog>>showHits.

JW> Not that it matters in this case but how would I work around
JW> this if it were a real application that needed to handle data in
JW> this way?

First: really try
TimeProfileBrowser spyOn: [WebLog new start ]
and learn to interpret the results. No offense intended! Speed
measurements are tricky but starting to optimize for speed without
having measured usually will get you nowhere.

You need to clearly understand where your time goes. Then you can know
where to optimize.

There is no general solution and it all depends on the real
application.

All that said, from the top of my head for this special case:

-If your text data are UTF8, read the file binary and do some optimized
processing on binary data. It will be far less elegant.

-Disable UTF8 support as Bert suggested (never tried) if you can live
with the consequences (or use Cuis). As far as I scanned the files
there is no multi byte character in them.

-Use some language better suited to the task to do some preprocessing.


Cheers,

Herbert   



More information about the Beginners mailing list