Re: [Phplib-users] Benchmark of Db class
Brought to you by:
nhruby,
richardarcher
From: nathan r. h. <na...@ds...> - 2001-10-26 15:43:01
|
On Fri, 26 Oct 2001, Donncha O Caoimh wrote: > 1. Yes, he could leave out that $db->connect() call. Creating the $db > object should be enough. > 2. I would suspect that accessing the Record[] array directly instead of > calling the f() function is slightly faster. This is the way I've always > accessed the MySQL result set. f() is handy in situations where you can use it. You can also get $db->Record['column_name'] as DB_Sql will by default retrive numricaly indexed and named indexed arrays in parallel $db->Record[0] and $db->Record['first_col'] are the same. This can be tuned by specifiying mysql_fest_array's result_type in the class. This at some point shoul be a class definable option, as well as using *_fetch_object. The DB classes are going to get an overhaul soon. > 3. By using integer indexes he may save some milliseconds. I'm only > guessing since text inside "quotes" is interpreted by PHP. > 4. I would also question his use of $db->free() as well. I have never > had to use it, and AFAIK db_mysql.inc calls the MySQL free() function > when it's needed. It's outside the main while() loop so it shouldn't be > too much of a slow down. > > I don't think he could have done much to make this query faster, and I > was happy to see Phplib do so well. The fact that adodb won wasn't a > surprise, but I won't discount that it may be better in certain > conditions than phplib. > I belive his record sets were small (200 entires) I'd like to see something with 2,000 entires as well. Yes, php did quite well, but there are a few places where the code can be tightend, espiaclly in terms of tuning for php4. If AODB is written for php, there's cerianly where the speed gain is. -n -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |