alexreuter
Programmer
Hello,
This is my first post here.
We have a static engine which returns reports, and I am working with a multi threaded testing application in an effort to test its scalability.
We are running inside java 1.1.8 on Solaris 7, with dual 4?? mhz processors and a couple gigs of ram. Here's my question:
The static engine has an Engine.load() method which initializes a bunch of instance data, xml files, hashtables..etc. When I simulate 4 concurrent requests to this engine I load the engine 2 ways.
1. Inside the main method, before I kick off the 4 requests(using threads obviously).
2. Inside the goTest() method, which is called by run().
When Engine.load() is called inside the goTest() method, it is called 4 times. This would seem to be a waste of time. I didn't notice this until we ramped up the number of requests and load time slowed to a crawl. So thats when I moved the Engine.load() call out to the main method, loading before sending off the requests. Heres the weird behavior:
After loading the 2nd way (with all the extra loads), reports, that is requests which use the static engine which was just loaded, perform 2-3 times FASTER?!? than if it is loaded a single time inside the main method.
Does anyone know why this might be?
I know for a fact that there are not multiple instances of the Engine being created because I unloaded() it with the last request as an experiment and all the instance data was wiped and all the requests failed.
So to summarize, why would mulitple loading of a static class improve performance by 200-300%?
TIA for any replies,
alex reuter
This is my first post here.
We have a static engine which returns reports, and I am working with a multi threaded testing application in an effort to test its scalability.
We are running inside java 1.1.8 on Solaris 7, with dual 4?? mhz processors and a couple gigs of ram. Here's my question:
The static engine has an Engine.load() method which initializes a bunch of instance data, xml files, hashtables..etc. When I simulate 4 concurrent requests to this engine I load the engine 2 ways.
1. Inside the main method, before I kick off the 4 requests(using threads obviously).
2. Inside the goTest() method, which is called by run().
When Engine.load() is called inside the goTest() method, it is called 4 times. This would seem to be a waste of time. I didn't notice this until we ramped up the number of requests and load time slowed to a crawl. So thats when I moved the Engine.load() call out to the main method, loading before sending off the requests. Heres the weird behavior:
After loading the 2nd way (with all the extra loads), reports, that is requests which use the static engine which was just loaded, perform 2-3 times FASTER?!? than if it is loaded a single time inside the main method.
Does anyone know why this might be?
I know for a fact that there are not multiple instances of the Engine being created because I unloaded() it with the last request as an experiment and all the instance data was wiped and all the requests failed.
So to summarize, why would mulitple loading of a static class improve performance by 200-300%?
TIA for any replies,
alex reuter