Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Misha
Newbie
Newbie



Joined: Oct 05, 2006
Posts: 15

PostPosted: Sun Jun 10, 2007 1:42 pm Reply with quote

Montego,

I'm using switch statement in my version, I learnt long ago in C that switch is more efficient than a long sequence of ifs, even elseifs.

You are improving performance with elseifs. Is it different in php? Or did I just forget something? I did not write anything in C for more than ten years already...

Thanks, Misha

_________________
www dot funandsafedriving dot com - My safe driving site 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1391

PostPosted: Sun Jun 10, 2007 4:55 pm Reply with quote

I will admit that I was more focused on the 1.1.0 release in getting the additional detail into the page titles and took the quick way out on improving upon performance. I would have had to run speed comparisons between if-then-elseif vs. switch or done alot of research.

I'll put it on the list to investigate further in the next enhancement release.

However, to be honest, the difference is going to be so minimal in this use case than if one was looping through a control structure like this 10's of thousands of times. The database calls is where most of the time is going to be spent here. But, every little bit helps and I am a curious guy... Wink
 
View user's profile Send private message Visit poster's website
Misha
Newbie
Newbie



Joined: Oct 05, 2006
Posts: 15

PostPosted: Sun Jun 10, 2007 5:03 pm Reply with quote

You mentioned that you used elsifs in this version, and I'm a curious guy, too Smile So I just thought it does not hurt to ask Wink

And you did not mention database calls optimization - at least I did not see this. I have a question here - is the way you do database calls now the optimal one? At least to the best of your knowledge?

Thanks, Misha

_________________
www dot funandsafedriving dot com - My safe driving site 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1391

PostPosted: Sun Jun 10, 2007 5:17 pm Reply with quote

To the best of my knowledge the answer is "yes" on the db calls. I had to make a few trade-offs for functionality purposes, but that is what design/programming is all about right? Wink

Why so curious? Are you having some particular issue that has sparked this curiousity?

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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 vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©