The MeteredStream class is used extensively throughout HotJava to
provide GUI feedback on the status of network connections. It is
unfortunately very inefficient, and causes HotJava and other systems
to suffer as a result.
What's the problem? It forces an update() on every single read(),
including byte-at-a-time reads. And update() is very expensive
GUI operation, both in terms of memory and CPU cycles.
There are many users of MeteredStream that read data byte-at-a-time.
Just fire up HotJava and do an AltaVista search. Notice how slowly
the results page is parsed. Surf to Gamelan. Notice how slowly the
sitemap data is downloaded.
Then if you really want to have some fun, try running the java-harness
in HotJava. What should normally take half an hour takes a whole
weekend.
Get the picture?
It seems incredibly silly that MeteredStream updates its friendly gooey
graphs for every single byte read. Even if it's a 50KB stream we're
reading. Lets see, reading 50KB would then result in 51200 updates
of the nice little graph. I think I see a performance problem.
stuart.ritchie@Eng 1996-11-23
provide GUI feedback on the status of network connections. It is
unfortunately very inefficient, and causes HotJava and other systems
to suffer as a result.
What's the problem? It forces an update() on every single read(),
including byte-at-a-time reads. And update() is very expensive
GUI operation, both in terms of memory and CPU cycles.
There are many users of MeteredStream that read data byte-at-a-time.
Just fire up HotJava and do an AltaVista search. Notice how slowly
the results page is parsed. Surf to Gamelan. Notice how slowly the
sitemap data is downloaded.
Then if you really want to have some fun, try running the java-harness
in HotJava. What should normally take half an hour takes a whole
weekend.
Get the picture?
It seems incredibly silly that MeteredStream updates its friendly gooey
graphs for every single byte read. Even if it's a 50KB stream we're
reading. Lets see, reading 50KB would then result in 51200 updates
of the nice little graph. I think I see a performance problem.
stuart.ritchie@Eng 1996-11-23