[Seaside] Re: Scaling Seaside apps (was: About SToR)
Keith Hodges
keith_hodges at yahoo.co.uk
Thu Aug 3 23:54:16 UTC 2006
Jeremy
am I right in understanding that what you are saying is that squeak is
simply not able to rip through strings as fast as perhaps a perl regex.
Does this mean that there is some overhead in the handling or Strings in
squeak that could use a look. I can imagine that ByteArrays may be more
efficient if less useful than Strings.
Just a thought, but as you talk about all this work with strings and so
forth I am wondering about object creation/deletion overhead.
One example for you. In a UI system that I once used, there were a lot
of Rect objects flying about. It turns out that in this case extreme
performance improvements could be had be simply reusing one Rect
instance and passing it into the routines that need it. Hundreds of
calculations and operations can all be performed without filling any
memory up with instances that are instantly thrown away and hang around
for extensive garbage collection later.
so for example
drawSquare: size
| w |
w := Rect new
w width: size height: size.
do things with a rect here...
becomes
drawSquare: size on: aRect
"note no new object allocation"
w width: size height: size.
do things with rect here.
I have used this tactic/pattern on several occasions many years ago, and
I struggle to remember the details of specific instances, but I think
one such instance was in an import routine. I was importing a data table
of alarms that are raised by a piece of telecoms equipment. The input
would have been a raw text file, the output 6000 or so populated objects
with some munging in between. Simply reusing the same object as a buffer
saved a lot of time.
best regards
Keith
___________________________________________________________
Yahoo! Messenger - with free PC-PC calling and photo sharing. http://uk.messenger.yahoo.com
More information about the Seaside
mailing list