It is currently Fri Apr 19, 2024 4:55 pm


The forum is READ ONLY. Please direct any future discussions to our Facebook page


 Page 1 of 1 [ 4 posts ] 
Author Message
 Post subject: New Smarty-Light Template Engine Installed
PostPosted: Fri Jun 24, 2005 1:46 am 
Developer
Developer
User avatar

Joined: Wed Feb 19, 2003 6:07 pm
Posts: 2930
I have just replaced the original Smarty Template engine that was being used by this website with a new, smaller, faster template engine called Smarty Light.

This is basically a heavily scaled down version of Smarty that was written from the ground up to use less memory and be very fast. It doesn't have all of the bells and whistles of Smarty but most of those things are never needed by most people creating templated web pages anyway. The great thing about this package is we didn't have to change any of our program code or template code except for one item and that was the SECTION command. It was very easy to convert those over to use the FOREACH command for Smarty.

There were a couple of things that were missing from Smarty Light that we needed for the game but they were very easy to add. Both the template engine and compiler engine use about HALF the memory that the full Smarty requires.

Everyone browser around the website and check out various blogs and let me know if you notice anything different.

Well, I also took the plunge and installed Smarty Light on the Main Game. It should work without any problems but please let me know if any pages show errors.

Well, now I am even more glad we are switching to this new template engine. It found two variable bugs in the spy.tpl file. This bug was in ALL of the templates but Smarty just ignored it completely while Smarty Light actually found and reported it.

[Edit:]
I wish I would have read the documentation to Smarty Light earlier. The programmer for this package is great. :) He basically replaced the SECTION (what I always thought sucked) command with a real FOR loop similar to the one used in PHP. This means just about every single block of PHP code in our templates can be replaced using the for tag. That's about the only reason we were using PHP tags in the templates. The templates for the game will finally be just that, templates. :)


Last edited by Panama Jack on Sun Oct 09, 2005 3:35 pm, edited 1 time in total.


_________________
PJ's Annoyingly Useless Blog
ADOdb Lite
Template Lite
Offline
 Profile  
 
 Post subject:
PostPosted: Sat Jun 25, 2005 6:51 pm 
Developer
Developer
User avatar

Joined: Wed Feb 19, 2003 6:07 pm
Posts: 2930
All I have to say is WOW...

Replacing Smarty with Smarty-Light, ADOdb with ADOdb Lite and changing a bunch of execute commands to SelectLimit commands has made one hell of a big difference on the CPU load on this weak old 1.2 gig AMD CPU. The load has dropped dramtically on the server and we could probably increase the maximum number of players to 30 online at the same time before the server became overloaded. :D That's really fantastic.

Man I can't wait to started testing 0.30 to see how low the load is with say 20 people online. We will probably be rebuilding the server that died on us last month. We will be rebuilding it with Fedora Core 4. Fedora Core 4 is one of the best version of Linux out there and what is great about this new release is that it comes with PHP 5 instead of PHP 4. It also doesn't come with any version of MySql making it alot easier to install the latest version of MySql.

So the new gaming server will be running on a 2.2 gig CPU, latest version of Fedora Core, latest version of PHP 5 and the latest version of MySql 4.

The great thing is that ADOdb Lite and Smarty-Light is 100% compatible with PHP 5. It will be exciting to see how well everything runs on the latest server code. It should use far less memory per client. My work server at home uses about 1/10th of the memory per client than the current game server and that will mean we can have even more people playing online at the same time than ever before. :D

I know the wait has been a long one for a new version but it will be well worth it for both the players AND the people hosting games on their own servers.



_________________
PJ's Annoyingly Useless Blog
ADOdb Lite
Template Lite
Offline
 Profile  
 
 Post subject:
PostPosted: Sat Jun 25, 2005 10:16 pm 
AA Mega-Trader
AA Mega-Trader
User avatar

Joined: Thu Sep 18, 2003 2:20 am
Posts: 323
Location: Rotorua, New Zealand
PJ, any ideas on when we will be able to play/test .30? :D

Days/weeks or months?????

Cheers



_________________
Alf (Alien life form)
http://www.cole.gen.nz
Rotorua, New Zealand
Offline
 Profile  
 
 Post subject:
PostPosted: Sun Jun 26, 2005 12:42 am 
Site Admin
Site Admin
User avatar

Joined: Wed Feb 19, 2003 12:17 pm
Posts: 2619
WOW is right... I just replaced both adodb and smarty with these two lite versions for use in my CMS. I gotta say until ya use it, don't knock it. For my highload sites this will be a godsend...course they gotta convert everything to actually use smarty now, but all in good time.

Thumbs up to developers that remember the values of tight code. The overbloated Microsoft world tends to make programmers lazy and its nice to see tight code for once!


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

cron