codeplay
codeplay

Reputation: 610

Jsf 2.0 performance gain

Jsf 1.x compiles jsp into servlet, jsf 2 use vdl instead of jsp, I wonder what is the source of performance gain compared to jsf 1.x?

Upvotes: 0

Views: 1292

Answers (1)

lu4242
lu4242

Reputation: 2318

The most important reasons why JSF 2 performs better are:

  1. Use a fast SAX parser instead an static compiler (facelets): An Abstract Syntax Tree (AST) is built and keep in memory, so further request don't require parse the xml once built and component tree creation is done without extra steps.
  2. Partial State Saving algorithm (taken from MyFaces Trinidad).

If you are looking on MyFaces 2.0.x/2.1.x, you'll get these improvements too:

  1. Refresh build view when necessary (MyFaces 2.0.x/2.1.x specific): Only refresh view on PSS on postback when necessary (see org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS).
  2. Caching EL expressions when necessary (coming soon on MyFaces 2.0.8/2.1.2): EL expressions are cached wit the AST, so no extra EL parsing per request is done. (see MYFACES-3160 for details)

JSF 2 is a big step in the righ direction.

Upvotes: 2

Related Questions