CodeIgniter Forums
Performance Lag in Codeigniter 4.4.5 Pagination - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Performance Lag in Codeigniter 4.4.5 Pagination (/showthread.php?tid=90158)



Performance Lag in Codeigniter 4.4.5 Pagination - Corsari - 02-18-2024

Hello


This makes me crazy



I'm facing a performance issue and would appreciate some insights. 

I have a PHP application that I've implemented in vanilla PHP (using PDO and Zebra Pagination) 

in these days I have rewritten it in Codeigniter 4.4.5 on the same host. 

The app is a simple CRUD app and it displays those rows from a MariaDB database with 700 rows, paginated at 10 rows per page, from a table with just and only 7 columns.

Here's the problem: when browsing the paginated pages, the vanilla PHP app changes pages instantly, but the Codeigniter 4.4.5 version has an unexpected lag of more than 1.5 seconds.

Details:
  • Host: Linux-based
  • PHP versions tried: 7.4 and 8.0.23 (no difference observed)
  • MariaDB version: 10.3.32
I've set up virtual hosts, allowing both applications to be simultaneously usable as I'm on a LAN and the server is a local PC: mean I'm comparing the behavior live and direct simultaneously

Any suggestions on what I should check to identify and resolve this performance lag in the Codeigniter application?

Thank you for your assistance!



Details about the main view

the Model is the default created with spark

in the controller the index() method is just



PHP Code:
    public function index()
    {
        $data['rows'] =  $this->modelChiamate->orderBy('data''DESC')
                                             ->paginate(10);
        
        $data
['pager'] = $this->modelChiamate->pager;

        return view('index'$data);
    

My mistake. 

Using the developer tools, I realized that the debug bar was still enabled  Cry ... its icon was right in front of me, but I overlooked it. 

I was in development mode, and the debug bar was causing a 1-second delay.


RE: Performance Lag in Codeigniter 4.4.5 Pagination - InsiteFX - 02-18-2024

app/Config/Filters/Filters.php

PHP Code:
// Always applied before every request
public $globals = [
    'before' => [
        //'honeypot'
        // 'csrf',
    ],
    'after'  => [
        'toolbar'// Remark this out to not use in debug mode.
        //'honeypot'
    ],
]; 



RE: Performance Lag in Codeigniter 4.4.5 Pagination - kenjis - 02-18-2024

See https://www.codeigniter.com/user_guide/installation/running.html#initial-configuration