Giter VIP home page Giter VIP logo

fauxjsp's People

Contributors

dependabot[bot] avatar ggeorgovassilis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cbuschka

fauxjsp's Issues

variable aliasing

Given:

  1. a tag file with a declared attribute X
  2. a JSP which has a variable X in scope (request.getAttribute("X"))
  3. JSP uses the tag file and passes a value for attribute X, e.g.

X=123
<prefix:tagfile X="456"/>

Expected result: "tagfile" reads "456" as the value of X
Actual result: "tagfile" reads "123" as the value of X

Performance of JspRendererImpl

TestPerformance.testJspRenderer records dropping renderer performance over last month's commits. The test uses a rather simple, nested, JSP with tagsfiles which renders a large tree of nodes. It used to be able to render a few dozen pages/sec, now it's down to 2 pages/sec.

I'm recording some of the findings and why, for now, I won't fix this issue. In short: fixing the findings would require caching, which introduces state, which is an opportunity for bugs. The stated mission of fauxjsp is to be as simple and robust as possible.

Improve scriptlet performance

Runtime profiling revealed that beanshell accesses the container class loader multiple times for every invocation, being the highest self-time (3x the next highest self-time).

Regression of #8: memory leak

Interpreter instances stored in BeanshellScriptletRendererImpl.cachedInterpreters are assigned variables which are not cleared after invocation creating a memory leak.

Impact: one BeanshellScriptletRendererImpl instance is created per renderer and thrown away with that renderer after the page is rendered, which means that the memory leak is temporary and lasts for the duration of a page rendering but may be an issue with large, temporary objects. Another issue is that the scriptlet context will contain now variables from earlier invocations.

Mitigation: profiling showed that clearing variables with unset(varname) has a considerable performance impact.

Avoid unnecessary EL parsing

Text (e.g. <node>text</node>) and attribute values (e..g <a attribute="value">) are evaluated by EL with every rendering invocation; it is probably faster to determine during parsing which values contain EL and submit only those for evaluation.

Load resources from classpath

This feature deviates from JSP.

  • load tagfiles from classpath
  • import jsp fragments from classpath
  • include jsp fragments from classpath
  • write documentation
  • release new artefact

Make beanshell strict mode configurable

Beanshell offers a strict interpreter mode which conforms to Java-only syntax.

  • Make this a configurable option
  • document the option
  • alter documentation which states lenience as a drawback

cache parsers

  1. introduce a "production mode" flag
  2. when (1) is enabled then the FauxJspServlet caches parsers for requested URLs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.