Howdy, >Our JSP/Servlets perform some calculations based on some input from a >HTML Form. These calculations are a little bit complicated so they take >time to perform. However the output that they produce is relatively >small. The majority of our users will give the same input, so the >output is also known for those cases. If we can map the input given in >the form of a GET request (i.e. the URL) to a cache of outputs, we could >save a lot of time.
For this case, I would actually consider doing the pre-calculation and result caching in the calculator object or something hanging off of it, rather than the servlet output. That's because the output is small, so it's not like you're saving presentation/layout effort. Rather, you're trying to speed up business object creation. >Another question I have is, once a Servlet is executed, does it get >stored in memory so that it doesn't have to be read off the disc next >time? This is a basic java question (or rather OS/JVM question). Once a class is loaded, it's kept in memory, in a special section of the memory allocated to the JVM (known as the Permanent Generation). However, the creation and destruction of servlet instances is up to the container, although those are in-memory operation. As an aside, the penalty for loading a class from disk is tiny and if that's your worst performance bottleneck, you should publish a paper about your application ;) Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
