Scooby is WAY slow right now, so I am trying to get to the bottom of things.
What I notice right away is that the screen takes about 20 seconds to do the initial load with only 21 events! Yikes!
Here is a rough flow of the exection chain:
- Client - HTML page loads
- Client - pageCal.init() -
- Client - pageCal.loadEvents()
- Client - scoob.getEvents() - the call to the scooby service
- Server - getEvents() - the call on the server side
- Client - marshall
- Client - convertObjects() - converts hashes to proper prototypes
- Client - insertCalEvent - called once for each event
The first thing I did was time how long the method was taking on the server:
2005-10-19 16:33:10,036 DEBUG [Timer] END method 'run'(), thread 'http-8079-Processor25', elapsedTime: 143ms
Only 143ms - that doesn't seem to be the problem.
Let's check pageCal.loadEvents():
10/19/2005 - 16:55:55 DEBUG End function 'loadEvents'; elapsedTime: 16645ms
Yikes. That's not good. Let's dig deeper and check out just the service method:
10/19/2005 - 16:55:49 DEBUG End function 'getEvents'; elapsedTime: 9148ms
Well, That's a big chunk of the problem - about 55% of the problem is in getting the events from the server. The remaining 45% is drawing them it seems. Since I'm not so much the GUI guy, I'll start out dealing with getEvents();
Here it is broken down again, with a little more detail:
1. Client - scoob.getEvents() - the call to the scooby service - TIME: 9148ms
- Server - getEvents() - this is actually a wrapper around a JSON call:
- the JSON Call
- get stuff from the server
- marshall it
Let's see where the bottleneck(s) is(are). First the actual JSON with no wrapping:
10/19/2005 - 18:58:53 DEBUG End function 'getEvents'; elapsedTime: 447ms
Suprising! That's not bad at all. How about convertObjects()?
After adding some logging I get 11 seconds! Heh, that makes no sense, since it's longer than getEvents().
Maybe the problem is the logging....
Sure enough it drops down to two seconds after logging statements are removed.