config tests
| From: | Uros Gruber | Date: | Sun, 10 Aug 2003 08:23:50 +0000 |
| Subject: | config tests | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-159021@lists.php.net to get a copy of this message | ||
Hello!
I just made some speed tests getting configuration from DB.
For now I figured 2 ways doing this.
1. One value in each row
id | name | val
----------------------
1 | name1 | value1
........
2. using serialize($config) and saving this in one row.
$config is predefined array of configuration.
I test this with 100 config values. First I read all 100 rows for 1st
example, then I read only one row and then unserialize this to get
array.
Here is result:
1st example 0.0478450059891 86.74%
2nd example 0.0073139667511 13.26%
There you can see speed of second example. I wan't to know what do you
think about this. And what's your solutions of reading config from DB.
I saw that many big project still use first example.
--
Best regards,
Uros