Who better?
#2

cache_get_row is alot better and easier

thats a QUOTE from caching tutorial

Quote:
Originally Posted by AndreT
Посмотреть сообщение
Benefits of using the cache

* It is faster! Using cache functions instead of mysql_fetch_row is notably faster. For JernejL, loading 1300 vehicles from the database went from 6 seconds to 60 milliseconds (source) and from my personal experience, I can tell that loading 500 houses from a database is now at least 10-20 times faster (source). Here are some more results.
* It does not require the coder to store/free the query result! There's no need to call mysql_store_result() to store the result or mysql_free_result() to free the result after done processing it. Specifically the result freeing has proven itself to be a source of problems, specially for newer scripters.
* It is easier to read/write/modify! (depending on the programmer's own preference)
To continue with, parsing the query result has become simpler compared to several older methods like sscanf.


With mysql_fetch_row, no caching
1. mysql_fetch_row calls took 3065 milliseconds
2. sscanf (parsing) took 27ms in total (500 calls to function)
3. the rest of the house loading code took 129ms (irrelevant)
Total: 3221ms

With caching
1. cache functions (loading and parsing) took 166ms
2. the rest of the house loading code took 108ms (irrelevant)
Total: 274ms

From this, we can tell that using the caching functions is about 12 times faster in such example (with loops and huge rows of data being returned).
Reply


Messages In This Thread
Who better? - by ScriptWriter - 29.08.2012, 12:26
Re: Who better? - by HuSs3n - 29.08.2012, 12:32
Re: Who better? - by ScriptWriter - 29.08.2012, 17:18
Re: Who better? - by ScriptWriter - 29.08.2012, 19:54
Re: Who better? - by Misiur - 29.08.2012, 19:57
Re: Who better? - by HuSs3n - 29.08.2012, 20:14

Forum Jump:


Users browsing this thread: 2 Guest(s)