Navigation

RSS 2.0 New Entries Syndication Feed Atom 0.3 New Entries Syndication Feed

Show blog menu v

 

General

Use it

Documentation

Support

Sibling projects

RIFE powered

Valid XHTML 1.0 Transitional

Valid CSS!

Blogs : Latest entries

Bytecode generation rocks

Initially, RIFE templates were first converted to real Java source files and then compiled on-the-fly with a regular Java compiler. Since I started using ASM for the Java continuations engine of the web framework, I quickly throught that it would be a good idea to use it for generating bytecode directly from the template engine.

Since yesterday I got rather fed up with the wait everytime I modified a template file, I decided that I'd give it a shot. In less than half a day I got all the old code disabled and replaced by suitable ASM visitors. It truly is a great bytecode generation and manipulation library. A nice side effect is that if you don't precompile the templates for distribution (ie. only let them be generated at runtime) no disc access is performed at all. The bytecode is generated in memory and passed directly as a byte array to a dedicated classloader.

The speed benefits that I hoped this would offer definately made the effort worth-while. The pre-compilation of all templates of our latest project now takes 44 seconds instead of 8 minutes 33 seconds, that's almost 12 times faster!!!

posted by Geert Bevin in RIFE on May 8, 2004 9:16 AM : 2 comments [permalink]
 

 
 
 
Google
rifers.org web