Good find, thanks.<div><br clear="all"><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><b>Connect with us on: </b><a href="http://twitter.com/vtigercrm" style="color:rgb(0,0,204)" target="_blank">Twitter</a> <b>I</b> <a href="http://www.facebook.com/pages/vtiger/226866697333578?sk=wall" style="color:rgb(0,0,204)" target="_blank">Facebook</a> <b>I</b> <a href="http://blog.vtiger.com/" style="color:rgb(0,0,204)" target="_blank">Blog</a><b> I</b> <a href="http://wiki.vtiger.com/index.php/Main_Page" style="color:rgb(0,0,204)" target="_blank">Wiki</a> <b>I </b><a href="http://forums.vtiger.com/" style="color:rgb(0,0,204)" target="_blank">Forums </a><b>I</b> <a href="http://vtiger.com/" style="color:rgb(0,0,204)" target="_blank">Website</a></span></div>


<br><br><div class="gmail_quote">On Fri, Mar 15, 2013 at 9:18 PM, Adam Heinz <span dir="ltr"><<a href="mailto:amh@metricwise.net" target="_blank">amh@metricwise.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">I found a 100x performance improvement [1] in the csv export code today.  Turns out, if you don't do 1-4 database calls for every one of the 16,000 customers you're exporting, you can get your export time down from 80 minutes to 30 seconds.<font color="#000000"><span style="white-space:pre-wrap">  The </span></font><span style="white-space:pre-wrap">sanitizeValues function [2] is pretty much useless.  It wastes a ton of CPU cycles calling </span><font color="#000000"><span style="white-space:pre-wrap">fetchUserRole and getSubordinateRoleAndUsers (via getAssignedPicklistValues).  It populates the picklistValues member variable, which is never used.  It replaces uitype 10 crmids with entity names, which I like less than displaying the crmids, exporting the related tables, and using Excel VLOOKUP to do the cross referencing; essentially preserving referential integrity in your exported spreadsheets.</span></font><div>


<br></div><div>[1]</div><div><pre style="white-space:pre-wrap;word-wrap:break-word">Index: include/utils/export.php
===================================================================
--- include/utils/export.php    (revision 3285)
+++ include/utils/export.php    (revision 3943)
@@ -214,6 +214,6 @@
     while($val = $adb->fetchByAssoc($result, -1, false)){
                $new_arr = array();
-               $val = $__processor->sanitizeValues($val);
+//             $val = $__processor->sanitizeValues($val);
                foreach ($val as $key => $value){
                        if($type == 'Documents' && $key == 'description'){
</pre></div><div>[2] <a href="http://trac.vtiger.com/cgi-bin/trac.cgi/browser/vtigercrm/branches/5.4.0/include/utils/export.php#L280" target="_blank">http://trac.vtiger.com/cgi-bin/trac.cgi/browser/vtigercrm/branches/5.4.0/include/utils/export.php#L280</a></div>


</div>
<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br></div>