JSP Engine In-Memory Tree Execution to Cut Compilation Overhead

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The existing JavaServer Pages (JSP) engine faces inefficiencies due to the repeated compilation of Java code, especially when custom pages need to be recompiled frequently, leading to performance overhead and resource management challenges.

Innovation Solution

An optimized JSP engine model that parses the JSP source code, creates a tree representation in memory, and executes it dynamically, eliminating the need for repeated Java code compilation by maintaining an in-memory cache of tag instances and traversing the tree during page execution.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If the JSP container uses the traditional translation and compilation process for each request, then the JSP page can be dynamically processed and rendered, but the repeated compilation of Java code causes performance overhead and inefficiency

Engineering Contradiction:
ImproveJSP page processing speedVSAvoidcompilation time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by performing the translation of JSP to servlet code only once when the JSP page is first accessed or when it changes. The compiled servlet class is then cached and reused for subsequent requests, eliminating repeated compilation overhead while maintaining dynamic processing capabilities.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses copying by creating a servlet class copy from the translated JSP code and storing it in memory cache. This copied servlet class can be executed multiple times without requiring re-translation or re-compilation, significantly improving processing speed while minimizing compilation time loss.

Inventive Principle:
Principle #26Copying

2Reliability

If the JSP container recompiles custom pages frequently to reflect changes, then the system remains up-to-date with latest modifications, but resource management becomes challenging and performance deteriorates

Engineering Contradiction:
Improvecode update accuracyVSAvoidCPU usage
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent implements feedback by monitoring file system changes to detect when JSP source files are modified. The system only triggers re-translation and re-compilation when changes are detected, rather than recompiling on every request. This feedback mechanism ensures code updates are reflected accurately while minimizing unnecessary CPU usage for resource management.

Inventive Principle:
Principle #23Feedback

3Reliability

If the JSP container translates and compiles the servlet class on every request, then the most recent version of the JSP page is always executed, but the processing time increases significantly

Engineering Contradiction:
Improvepage version accuracyVSAvoidrequest processing speed
Core Design Contradiction:
ReliabilityVSSpeed

Solution Approach 1:

The patent applies preliminary action by translating and compiling the servlet class in advance when the JSP page is first accessed or when source code changes are detected. The pre-compiled servlet is then cached and executed for subsequent requests, ensuring the latest version is used while maintaining fast request processing speed.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses dynamics by making the servlet class lifecycle adaptive - it is re-compiled only when necessary (when source code changes) rather than on every request. This dynamic approach balances page version accuracy with request processing speed by adjusting compilation frequency based on actual change events.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS9658838B2Optimized JavaServer Pages lifecycle model
Publication Date: 2017.05.23 ORACLE INT CORP
  • US9658838B2 patent drawing
  • US9658838B2 patent drawing
  • US9658838B2 patent drawing

AI summary

Systems and methods are provided that service a JavaServer Page (“JSP”), including receiving a request for a JSP page, parsing source code for the JSP page, creating a tree of the parsed source code. executing the tree in memory, and returning the requested JSP page. Accordingly, JSP pages do not require repeated recompilation, and JSP pages with customized content may be quickly regenerated with a low performance overhead.