[Borges-users] performance/memory
Eric Hodel
drbrain at segment7.net
Sun Apr 11 00:43:08 EDT 2004
??????? ???????? (slepnev_v at rambler.ru) wrote:
> Hi,
>
> today I implemented my first small Borges app - wanted to show off
> Borges to my employer on Monday. I tried a small stress test: just
> clicking on links a lot of times, and watching the Task Manager
> window.
>
> The first version (which stored a continuation for every click)
> increased the memory about a megabyte per click, and started thrashing
> wildly at something like 80 megs. No response in 5 minutes.
> Unacceptable.
>
> The second version did not store any continuations, but increased the
> memory about 500K a click. I decided not to wait until it starts
> thrashing =) So:
>
> 1) Eric, you have a major bug somewhere. (Or is it Matz? =)
I'm quite certain its mine. (I would be very, very suprised if it was a
Ruby flaw.)
There are two problems with Borges, one is a bug where memory grows
seemingly unbounded. I need to track this down still.
The other is that Seaside uses *lots* of small objects, and
Smalltalk is very good at this. I don't think Ruby is quite that good,
and certainly is not nearly as fast as Smalltalk at handling them. As I
see fit, I'm rearchitecting parts of Borges to remove/reduce these tiny,
short-lived Objects in favor of other structures. Last weekend I
finished up changes to the HTML renderer and CallbackStore that will
help in this respect.
You can fetch a newer Borges from CVS which has these fixes.
> 2) How can I disable old pages altogether? I can design my app around
> this. Maybe it could help. Borges has many other cool features I just
> can't let go of now.
You can reduce the number of saved pages by changing the value of
Borges::LRUCache::DEFAULT_CAPACITY. Currently this is set to 20.
I'm not sure exactly where the bug is, so eliminating use of the
LRUCache completely in Borges::Session (@continuations) may or may not
stop the memmory growth, but that is also worth a shot.
> Vladimir Slepnev
>
> P.S. Just tried the same test on the SushiNet example: simply hitting
> the "Browse" link repeatedly. Increases memory about 2.5M per click.
> Sad.
Yes, I'm well aware of the problem.
--
Eric Hodel - drbrain at segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/borges-users/attachments/20040410/dae1aa51/attachment.bin
More information about the Borges-users
mailing list