Welcome Guest, Not a member yet? Register   Sign In
Performance/Benchmark questions
#1

[eluser]hykoh[/eluser]
I just have a few questions about the performance with CI Smile

- What does the {memory_usage} calculate ? The RAM usage of the system or what else ?
- When should i optimize my system ? From which value of memory_usage / elapsed_time ?
At the moment my project takes 0.0602 / 1.31MB for one siteload. Is it too much ? it runs on a vserver without other load.

Another question is (i know - its maybe not the right forum, but nearly the same topic Smile), should i use

Code:
$sql = SELECT COUNT(*) AS cnt FROM example WHERE x = y
// i use PDO with a wrapper class
$stmt = $pdo->query($sql);
$row = $stmt->fetch();

return $row['cnt']

or

Code:
$sql = SELECT id FROM example WHERE x = y
// i use PDO with a wrapper class
$stmt = $pdo->query($sql);

return $stmt->numRows() // or known as mysql_num_rows()

Is it recommend to use COUNT about the database (if yes - should i use COUNT(id) or something like that instead of * ?)

Or should the num_rows() function get me more performance ?
#2

[eluser]xwero[/eluser]
For the sql question, i think it depends more on how are you going to use the information than on what is the fastest way.

If the only information you want to know is the row count you are better off with COUNT in the sql statement. If you are after the field values you can always do a check to see how many rows there are in the result if it's needed.
#3

[eluser]hykoh[/eluser]
What about my main questions ? the first both Wink
#4

[eluser]JoostV[/eluser]
I stumbled upon this page with benchmark results for Codeigniter vs. Zend framework.

In this particular test, CodeIgniter is over twice the speed of the Zend framework in all cases.

- CodeIgniter: 1.6.3
- Zend Framework: 1.5.2

http://www.avnetlabs.com/php/php-framewo...benchmarks

Just thought I'd share.
#5

[eluser]TheActionCombo[/eluser]
[quote author="JoostV" date="1224599760"]I stumbled upon this page with benchmark results for Codeigniter vs. Zend framework.

In this particular test, CodeIgniter is over twice the speed of the Zend framework in all cases.

- CodeIgniter: 1.6.3
- Zend Framework: 1.5.2

http://www.avnetlabs.com/php/php-framewo...benchmarks

Just thought I'd share.[/quote]

And we could hand-code PHP from scratch that's faster than both. The point of using a framework is to automate repetitive tasks and reduce development time. If you're choosing a framework based on performance, you're choosing it for the wrong reasons. Choose CodeIgniter for its ease of use and superior documentation, not its performance -- the framework is never the bottleneck.
#6

[eluser]JoostV[/eluser]
Spot on, TheActionCombo. Otherwise we'd all be coding static html pages.




Theme © iAndrew 2016 - Forum software by © MyBB