EUCOOKIELAW_BANNER_TITLE

  • I think that

    Making the Web is like playing a game. Standard, Accessibility and Usability are only few rules.
    No game is awesome if you don't follow the rules.

    International Webmasters Association

  • Subscribe to my blog via email

    Insert here your e-mail address and you will receive a message when a new post will come.

ALPHA Framework: Model 2.x … what’s new?

Some months ago I’ve started to work to a big project using ALPHA Framework. This project is pushing ALPHA Framework to its full potentials and, thanks to that, I’m discovering a some bugs and making a lot of improvements in the source code.

In the latest two weeks is what has happened to the Model Class (Versions 2.0, 2.1, 2.2, 2.3).

Let’s discover the news!

Model

Just few words to introduce this class: its goal is to get a template file based on CuTeML Syntax and render it as a classic HTML page.

During the Web Application development, I was working with several thousand of variables on some interfaces, and the performance of the template not fulfill my expectations!

Against Smarty, this Template Engine does not convert the template file in a PHP file. So performances cannot be gained at the compiling time, and cannot optimize the conversion to PHP script, it does not exist! ;-) The only way to improve the Model performance is to remove all the “exceeding fat”.  Not to make just another template compiler.

Since version 2.0 the goal is to make the engine faster and the results of the efforts are, today strabiliant!

With several thousands of variables on the page the Model Class takes no more than 3 seconds to render the page and serve it to the client the first time and 1 millisecond the second time. This thanks to a lot of changes that was reported in the change log on the top of the class.

/*
 * ChangeLog:
 * 
 * V 2.0
 * - Refactored a lot of source code
 * - Better memory management
 * - Improved Variable management
 * - Refactoring of constants
 * - Better documented (need more documentation)
 * - Partially removed debug calls: 
 *   - to improve performances
 *   - in favour of uint tests 
 * 
 * V 2.1
 * - Optimized code to improve performance (800% faster)
 * - Complete removal of debug calls
 * - Improved ClearSubvar method 
 * - Improved documentation
 * - minor bugfix
 *
 * V 2.2
 * - Some improvements in the Cache Manager
 * - Added private method replaceVar (to improve general templating performance)
 * - Minor bugfixes
 * - added 'count' variable to iterator
 * - set the scope (public / private) for the class methods
 * - Improved documentation
 *
 * V 2.3
 * - Introduced the new cuteml element {break:var}
 * - removed an undefined variable from replaceVar() method
 *
 */

One thought on “ALPHA Framework: Model 2.x … what’s new?