Re: benchmark tests on mdb + others

From: Date: Tue, 28 Jan 2003 11:25:26 +0000
Subject: Re: benchmark tests on mdb + others
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3493@lists.php.net to get a copy of this message
Hello, On 01/28/2003 06:37 AM, Electroteque wrote:
sorry i got this late , so what you are saying , i require definately speed for some of the sites at work so therefore i should use the native funtions which means i have to develop an error handler , i have some apps i am about to release so portability is my concern so therefore a dba should be the choice ?
Like with everything, you need to balance the cons and the pros. So, first you need to exclude what is not acceptable for you. If you need all the speed you can get and your application is changing the database continuously, a database abstraction layer may add enough overhead to not be acceptable, but that is something for you to judge. OTOH, smart software always beat fast software. This means that since database access will be the probably the most expensive part of the software in terms of time of execution, often a better alternative is to avoid needless database accesses. For instance, if you have some information that you display frequently in you sites pages, usually it is smarter to cache in disk files the content of whole pages or just parts of them that is generated from frequently accessed database information. Some people may suggest to cache individual query results but in my experience that is not worthy unless the query is very expensive. It is often better to cache the actual HTML that results from performing several queries than just caching the results of one query because traversing cached query results also takes some time and memory. I use this caching class in my sites because it handles very busy accesses where cached data may be update and accessed simultaneously. The class takes care that the cached data is not corrupted by simultaneous access trying to update it. It also provides a way to force invalidation so next time the cache is accessed the data is regenerated. This is very useful in case the cache can be updated in any moment and so you can't antecipate for how long the cache will be valid. Since the class can cache any type of data of any length, I can cache query results too very efficiently. However I usually do not do that for the efficiency reasons pointed above. http://www.phpclasses.org/filecacheclass -- Regards, Manuel Lemos

« previous php.pear.general (#3493) next »