سؤال

Yesterday I asked this question on if loading/importing classes/& creating objects from external libraries in servlets cause any performance issue ? Answer I got is may or may not but if library size is big and if we are initiating memory intensive/time consuming jar in Servlet, it is surely going to slow down page load time.

Further question is : is it possible that if we use Listners, (initiate objects from time consuming libs on Tomcat startup, and use them in servlets wherever needed) we can save time taken on every pageload ?

هل كانت مفيدة؟

المحلول

Generally speaking, you will only save time in the first or initial pageloads.

Once the Classloader builds up the library and its instances generated by your application, further pageloads would be barelly affected.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top