Welcome Guest, Not a member yet? Register   Sign In
My Application Runs Slow
#11

[eluser]Krzemo[/eluser]
Please do a quick test: turn KAV off for few secs (im sure you are aware of eventual consequences Wink) and check app performance. If there is an improvement you are home.
Let us know how it worked - if that is dead end - we'll dig deeper.
#12

[eluser]GwO[/eluser]
I did't turn off my KAV, but suddenly my web works "normally"(I noted that before I read that last post). I tested it in others PCs on my LAN and it worked fine, so I supposed it was a problem on my PC at that time. But my doubt is: If I load too many libraries,helpers, etc it could turn my application slow?

p.d. english is not my mother language so, forgive me if wrote something wrong!
#13

[eluser]InsiteFX[/eluser]
Only load what you need!

InsiteFX
#14

[eluser]bretticus[/eluser]
Seriously, asking for suggestions while offering no code and no benchmarks is pretty much a waste of your time and everyone else.

Here's a video that explains how to turn on your profiler. The output generated is the best first step in helping others point out any performance bottlenecks.
#15

[eluser]dalunatic[/eluser]
While developing I noticed (after weeks, working day in and day out) that gradually the day passes, the page loads eventually went up. Especially visible with FireBug (in combination with firePHP) addons for Firefox, which makes page loads times visible.

So in the morning the loads were around the 250 ms and after every run it adds 100-200ms. What was the case? Codeigniter logging! I am developing on an 8 year dual core system but 100KBs of log files makes it heap!! Not XAMPP or Apache or a defective hdd or anything else!

I looked at the log files in system/logs/ and they mostly were between 300-800kb. Removing the logfile of the current day, made the whole site (locally of course) run swiftly! I am using logging more carefully now, only when needed, otherwise i turn it off in config/config.php:

Code:
$config['log_threshold'] = 0;

Hope this helps other people, I stumbled on it by accident while I was looking for other apps to blame!

Edit: with loading times up to 20 sec!
#16

[eluser]Unknown[/eluser]
I just changed my log config from 2 to 1 and it really helped the loading time of my application (Went from up to 10 seconds to less than one second).

Code:
$config['log_threshold'] = 1;

Looks like CI's debug messages log slows down the application a lot !

Thanks!
#17

[eluser]InsiteFX[/eluser]
This could be anything, but I would start profiling and benchmarking my code also check your database query accesses they can be a real problem!

Benchmarking:
Code:
$this->benchmark->mark('code_start');

// Some code happens here
$this->benchmark->mark('code_end');

echo $this->benchmark->elapsed_time('code_start', 'code_end');

Profiling:
Code:
$this->output->enable_profiler(TRUE);

$this->benchmark->mark('my_mark_start');

// Some code happens here...

$this->benchmark->mark('my_mark_end');

$this->benchmark->mark('another_mark_start');

// Some more code happens here...

$this->benchmark->mark('another_mark_end');

I have already setup the profiler.php file for the different settings, here it is!

application/config/profiler.php
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
|    http://ellislab.com/codeigniter/user-guide/general/profiling.html
|
| -------------------------------------------------------------------------
|
| To turn off a setting set it to ( boolean ) FALSE
| To turn on  a setting set it to ( boolean ) TRUE
| -------------------------------------------------------------------------
*/

$config['benchmarks']      = FALSE;
$config['config']          = FALSE;
$config['controller_info'] = FALSE;
$config['get']             = FALSE;
$config['http_headers']    = FALSE;
$config['memory_usage']    = FALSE;
$config['post']            = FALSE;
$config['queries']         = FALSE;
$config['uri_string']      = FALSE;

// ------------------------------------------------------------------------
/* End of file profiler.php */
/* Location: ./application/config/profiler.php */

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB