Welcome Guest, Not a member yet? Register   Sign In
Nice Code Tipp is needed or how to minimize memory usage
#1

[eluser]Gewa[/eluser]
Hi, I am not a profi php programmer,so I liked the way codeigniter is developed. MVC is cool. But now when I am working with big datasets (yellowpages with 140.000 firms, and more than 800Categories) I need a tip how to minimize memory usage .

I have 2 general problems with project.

a) project is in UTF-8 and after cashing its showing unreadable characters ( when unicode cirilic or other languages texts are used)

b) memory usage of 3MB-6Mb...


Usually I call database directly from controller , then parsing data , generate HTML in controller, and pass it to views

lets say
Code:
$qq=$this->db->get('categories);


foreach($qq->result as $cat){


$data['mod_listing'].="<li><a href="/category/show_cat/">cat_id."/>".$cat->cat_name."</a>";
}

$this->load->view('cat_template',$data);

and then in cat_template.php just echoing $mod_listing....




After I discovered that if I generate the HTML inside the Model, and call this model directly from view file with making

Code:
&lt;? echo $this->cat_model->show_cats();?&gt;

will decrease memory usage lets say 10% not so much...



BUT WHAT IS THE PERFECT WAY?


HOW YOU DO?


Messages In This Thread
Nice Code Tipp is needed or how to minimize memory usage - by El Forum - 03-17-2009, 06:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB