| Author |
Message |
Misha
Newbie


Joined: Oct 05, 2006
Posts: 15
|
Posted:
Sun Jun 10, 2007 1:42 pm |
|
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 |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Sun Jun 10, 2007 4:55 pm |
|
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...  |
| |
|
|
 |
Misha
Newbie


Joined: Oct 05, 2006
Posts: 15
|
Posted:
Sun Jun 10, 2007 5:03 pm |
|
You mentioned that you used elsifs in this version, and I'm a curious guy, too So I just thought it does not hurt to ask
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 |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Sun Jun 10, 2007 5:17 pm |
|
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?
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 |
|
|
 |
|
|