Links from 2012-03-24
xpages - Is there a performance hit in SSJS when using @Functions? - Stack Overflow
All SSJS is parsed into an AST (abstract syntax tree) at runtime. In other words, your code just remains a String until the exact moment that it is executed, at which point a parser examines that String to syntactically identify what the code contains: which characters denote variables, which are operators, functions, etc. This is why SSJS is always slower than the directly equivalent Java: if you just write your code in Java to begin with, then it’s compiled into bytecode the moment you build your project, but perhaps more importantly, at runtime it doesn’t have to „guess” what code to run by parsing a String… it just runs the Java code you already defined. But if your goal is optimization, you’ll gain far more improvement by moving all code from SSJS blocks to bean methods than you will by eschewing the convenience of @Functions in favor of native JavaScript, because even native JavaScript has to be parsed into an AST.It’s time to start using JavaScript strict mode | NCZOnline
ECMAScript 5 introduced strict mode to JavaScript. The intent is to allow developers to opt-in to a “better” version of JavaScript, where some of the most common and egregious errors are handled differently. For a while, I was skeptical, especially with only one browser (Firefox) initially supporting strict mode. Fast forward to today, every major browser supports strict mode in their latest version, including Internet Explorer 10 and Opera 12. It’s time to start using strict mode. Tagged as: delicious, links | Author: Martin Leyrer
[Sonntag, 20120325, 04:00 | permanent link | 0 Kommentar(e)
Comments are closed for this story.