You are here: Re: PHP/MySQL warnings about results « PHP Programming Language « IT news, forums, messages
Re: PHP/MySQL warnings about results

Posted by Michael Fesser on 11/25/07 16:37

..oO(Knut Krueger)

>> CPU cycles have nothing to do with it. This is all about good
>> programming techniques.
>>
>sure are CPU cycles and therefore SQL queries a question especially at
>an internetserver.

An if-branch or a function call really mean nothing to the CPU. But as
said elsewhere in this thread, it would be better to use two separate
functions, one for SELECT, another for INSERT/UPDATE/DELETE. This avoids
the problem right from the beginning. Couldn't be more efficient.

>> It is much better to not make the call you know is going to cause an
>> error in the first place. The way you're doing it is just sloppy
>> programming. Such techniques are problems just waiting to happen.
>
>If the record is more than 50% available, then there are less sql
>queries with the suppress error method otherwise with the other method
>is better.

Huh? The DB queries are the same. The difference is how the results (or
better the non-results) are handled.

>I started programming with assembler and 8068 processors and in this
>time everybody must take care about CPU and memory usage.

PHP is not assembler, it's a much more abstract language. Optimization
in PHP starts on the algorithms, not on single CPU instructions or
language constructs. Google "premature optimization" if you want.

>In both cases the error handling was important but it was in different ways.
>and using the @ including an error handling should not a bad programming
>style if the usage of the server is more less.
>
>Therefore I my mind there is still the question which way is with less
>cpu usage. That's not the question for one user, but for 1000 users
>simultaneously

If you run into performance problems, use a profiler to find the real
bottlenecks. It will definitely not be the error handling.

Micha

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация