Welcome Guest, Not a member yet? Register   Sign In
ion_auth's 1.2mb memory usage
#2

HI,

I'm not so familiar with your code, but profiling gives me the following result:

I've benchmarked Codeigniter 3.1.6's Welcome controller with the latest ion auth from git.

bare                                         499800 bytes
bare + session library                 522880 bytes
bare + session library + ion_auth 776272 bytes

So for me the difference is 253392 bytes (0.24 MB) with which i can live with.

Also this is on PHP 7.1.11 which has lower memory usage compared to PHP 5.x.x

I've also checked what happens if i just load the ion_auth_model and create a copy of the logged_in() function locally.

The memory usage in that case was:  758864 bytes (0.225 MB), so for me it is not worth it to create a custom lib for this.

PHP Code:
public function loggedin()
 {
 
$this->load->model('ion_auth_model');

 
$this->ion_auth_model->trigger_events('logged_in');

 
$recheck $this->ion_auth_model->recheck_session();

 
// auto-login the user if they are remembered
 
if (!$recheck && get_cookie($this->config->item('identity_cookie_name''ion_auth')) && get_cookie($this->config->item('remember_cookie_name''ion_auth')))
 {
 
$recheck $this->ion_auth_model->login_remembered_user();
 }

 return 
$recheck;
 } 
Reply


Messages In This Thread
ion_auth's 1.2mb memory usage - by ponzo - 12-13-2017, 01:37 PM
RE: ion_auth's 1.2mb memory usage - by qury - 12-14-2017, 03:21 AM
RE: ion_auth's 1.2mb memory usage - by ponzo - 12-14-2017, 04:06 AM
RE: ion_auth's 1.2mb memory usage - by qury - 12-14-2017, 02:55 PM
RE: ion_auth's 1.2mb memory usage - by ponzo - 12-14-2017, 03:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB