Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7876199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:07:51+00:00 2026-06-03T03:07:51+00:00

What techniques could I use to modify a set of JSPs to measure the

  • 0

What techniques could I use to modify a set of JSPs to measure the overall performance of the JSPs and then to further narrow down and identify the specific areas within the JSP where the most time is spent?

My current approach is to simply use a scriptlet and System.currentTimeMillis():

top of JSP

<%
StringBuilder result = new StringBuilder();
long startTime = System.currentTimeMillis();
%>

… JSP code here

<%
long duration = System.currentTimeMillis() - startTime;
if (duration > 100L) { //over  100 ms
    result.append("JSP page took "+duration+"ms");
}
%>
<!-- <%=result%> -->

But the problems with this are:

  • polluted JSPs with this performance code,
  • copy pasted code in several JSPs,
  • does not work well when JSPs are included with <%@ include … %> since the result variable is already be defined in multiple JSPs.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:07:52+00:00Added an answer on June 3, 2026 at 3:07 am

    #1 – the golden rule – don’t put any logic in JSPs. write custom tags. extract any logic into java code. JSP is the presentation layer.

    #2 – run servlet container in a profiler (like jvisualvm or even better: yourkit). This will tell you exactly where the time is spent

    NOTE – nowadays you don’t need to “run an app in a profiler” – if using JDK6+ you can pop open yourkit or jvisualvm (comes with JDK) and attach magically while it’s running. it’s really handy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What techniques could I use to make my jar file Reverse Engineer proof?
I am interested in comparisons of different techniques/approaches one could use to generate all
I am wondering if there is any language feature/library/tools/techniques I could use to call
I've researched some information about techniques I could use to unit test a DbContext
In Brian Goetz's article about safe construction techniques you could read: [...] often when
What specific techniques have you found to learn keyboard shortcuts while programming? I don't
I'm running Eclipse in Linux and I was told I could use Xdebug to
I need to retrieve a set of data from a database, then populate a
It would be glad if somebody could give me advice which techniques I should
Could somebody suggest a technique or class library to read up on for XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.