Welcome Guest, Not a member yet? Register   Sign In
Very slow if $data is big
#12

Ok. I have done more tests. First of all, I've commented the other queries to test one thing at a time. I've also emptied the view to see only the header and footer.

With this modifications, the Request loading time is 4016.

With a limit of 200, it takes 3038 to Request to load.
With a limit of 100, it takes 2039 to Request to load.
With a limit of 10, it takes 1396 to Request to load.

When executing the full query in phpMyAdmnin, I have this:
Total of 415, processing in 0.0054 second(s).

It's very quick.

If I print the result object in PHP ($query->getResult()), the duration loading of Request is 35!

If I do this:


PHP Code:
$data['commandes_data']  $this->CommandesModel->get_commandes();
print_r($data['commandes_data']);exit; 


The duration of Request is 37.

The only code after this is sending $data to the view:
PHP Code:
return $this->template->renderConnected("commandes_view"$data); 


Here is the renderConnected() function:


PHP Code:
  public function renderConnected($view$data = [])
  {
    $data['site_title'] = 'Télé Ciné Montréal';
    $content  view('inc/header_connected'$data);
    $content .= view('inc/menu_connected'$data);
    $content .= view($view$data);
    $content .= view('inc/footer_connected'$data);
    return $content;
  


This function is in app/Libraries/Template.php file.
 
Does the problem comes from this function?

I also want to say that other pages with other queries are loading very fast, I have this problem with orders and invoices pages only, the pages like companies, projects, clients, etc. are loading at a normal pace.

Thank you so much for helping me with this!
--
MarieveStrange
Web Programmer
Reply


Messages In This Thread
Very slow if $data is big - by MarieveStrange - 01-19-2023, 02:15 PM
RE: Very slow if $data is big - by InsiteFX - 01-20-2023, 12:52 AM
RE: Very slow if $data is big - by nc03061981 - 01-20-2023, 01:36 AM
RE: Very slow if $data is big - by davis.lasis - 01-20-2023, 02:46 AM
RE: Very slow if $data is big - by php_rocs - 01-20-2023, 09:45 AM
RE: Very slow if $data is big - by sheilaf - 01-20-2023, 12:19 PM
RE: Very slow if $data is big - by InsiteFX - 01-21-2023, 12:04 AM
RE: Very slow if $data is big - by MarieveStrange - 01-23-2023, 07:57 AM
RE: Very slow if $data is big - by superior - 01-23-2023, 08:54 AM
RE: Very slow if $data is big - by MarieveStrange - 01-24-2023, 01:02 PM
RE: Very slow if $data is big - by superior - 01-25-2023, 01:10 AM
RE: Very slow if $data is big - by MarieveStrange - 01-25-2023, 07:47 AM
RE: Very slow if $data is big - by superior - 01-25-2023, 08:39 AM
RE: Very slow if $data is big - by MarieveStrange - 01-25-2023, 09:40 AM
RE: Very slow if $data is big - by superior - 01-25-2023, 10:31 AM
RE: Very slow if $data is big - by MarieveStrange - 01-25-2023, 02:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB