qiang, on 09 December 2010 - 11:38 AM, said:
Make sure you turn on schema caching for AR. Otherwise, a lot of time in AR would be spent in retrieving schema information. With proper configuration, AR should lower the performance of DAO/PDO by 50% or less.
What do you mean by "proper configuration"? Is setting
schemaCachingDuration to a large value the only thing to do or using caching component and configuring schemaCacheID is also obligatory?
With only
schemaCachingDuration set, I got results like:
<tt>Done selecting 300 records (160 columns) using PDO! Execution time: 0,00766205788 seconds.
Done selecting 300 records (1 column) using PDO! Execution time: 0,00710415840 seconds.
Done selecting 300 records (160 columns) using DAO! Execution time: 0,01816511154 seconds.
Done selecting 300 records (1 column) using DAO! Execution time: 0,00933790207 seconds.
Done selecting 300 records (160 columns) using AR! Execution time: 2,38169789314 seconds.
Done selecting 300 records (1 column) using AR! Execution time: 0,05867600441 seconds.</tt>
Therefore I can't observe any noticeable performance upgrade with it. Times are comparable (aprox. 2,5 second for selecting 116 records/160 columns and aprox. 0,01 seconds for selecting 116 records/1 column).
Another question. What is the reasonable value for
schemaCachingDuration? If I have constant table schema, is it good idea to set this property to one day (86400 seconds) or even more?