| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
#1
|
|||||||
|
|||||||
![]() 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:
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
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#2
|
|||||||
|
|||||||
![]() 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}.
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
#3
|
|||||||||
|
|||||||||
![]() ...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 ! ![]() |
|||||||||
|
|||
X-Cart forums © 2001-2020
|