note 114360 added to function.fputcsv
| From: | mishadaratgmaildotcom | Date: | Wed, 12 Feb 2014 14:58:13 +0000 |
| Subject: | note 114360 added to function.fputcsv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198468@lists.php.net to get a copy of this message | ||
Optimization & Performance notes.
fputcsv as a solution may fit small chunk of data.
What if you have query resulting in 10k rows?
Looping it 10K iterations to create respected csv file is heavily both time & resource
consuming.
My rule of thumb for Max-Loop size in WEB code is around 1K iterations. Anything beyond it, should
performed either at background (ajax call for instance), or as cron, or... other solution that
available to bypass a loop.
MySQL engine has a function writing query results in CSV format directly to disk.
Bottom line - whenever it possible spare big loop processing time by moving whatever processed in
loop toward DB engine.
Eventually it will pleasantly impact your WEB page loading time.
----
Server IP: 72.55.140.6
Probable Submitter: 24.114.255.6
----
Manual Page -- http://php.net/manual/en/function.fputcsv.php
Edit -- https://master.php.net/note/edit/114360
Del: integrated -- https://master.php.net/note/delete/114360/integrated
Del: useless -- https://master.php.net/note/delete/114360/useless
Del: bad code -- https://master.php.net/note/delete/114360/bad+code
Del: spam -- https://master.php.net/note/delete/114360/spam
Del: non-english -- https://master.php.net/note/delete/114360/non-english
Del: in docs -- https://master.php.net/note/delete/114360/in+docs
Del: other reasons-- https://master.php.net/note/delete/114360
Reject -- https://master.php.net/note/reject/114360
Search -- https://master.php.net/manage/user-notes.php