![]() |
Code Bloat?
Dear Brain-Trust:
As I get closer to going live (I could press the button now if I wanted to) I have some minor concerns re: "code bloat" -- in other words, "can I optimize my code for better performance?" For example: 1. IF/ELSE code In products.tpl, I hard coded a few category exceptions, such as: Code:
{if $usertype eq "C" and $cat eq "6" or $cat eq "5" } Do these if/elses slow me down? Is there a better way to do this? 2. COMMENTED OUT CODE ? Does commented out code have any impact on performance? Should it be removed? How does the server look at commented out code? In many (most) of the .php pages, the X-Cart copyright notice is a big old paragraph. I would imagine that removing the copyright notice would probably be in violation of the license... Quote:
Basically, can we streamline performance by removing commented out code and tweaking if/else statements? Or if it doesn't matter, that's good to know... but if an expert could give me a yes/no/don't worry about it, I'd appreciate it. Thanks, Jeremy |
Re: Code Bloat?
None of the above is anything of concern performance-wise. Do watch out for {math ...} smarty tags as they are very expensive particularly where they are inside a {section ..} ... {/section} or {foreach ...} ... {/foreach}. X-Cart uses them too much for no good reason. Smarty supports most simple math directly without using the {math ...} tag and has a {counter} tag that could be used to replace a lot of X-Cart {math}.
|
Re: Code Bloat?
...Or they could just do the math within php, or simply use {php} instead of {math} and do the math cals. upon global or smarty scoped variables/arrays.
eval function, one letter away from evIl ! :) |
All times are GMT -8. The time now is 06:04 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.