<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-09-23 16:23 GMT+02:00 Marc Delisle <span dir="ltr"><<a href="mailto:marc@infomarc.info" target="_blank">marc@infomarc.info</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hugues Peccatte a écrit :<br>
<div><div class="h5">> 2014-09-22 21:08 GMT+02:00 Hugues Peccatte <<a href="mailto:hugues.peccatte@gmail.com">hugues.peccatte@gmail.com</a>>:<br>
><br>
>> 2014-09-22 18:44 GMT+02:00 Marc Delisle <<a href="mailto:marc@infomarc.info">marc@infomarc.info</a>>:<br>
>>> Hugues,<br>
>>> do you still have the branch where each commit was separate, before<br>
>>> squashing?<br>
>>> --<br>
>>> Marc Delisle (phpMyAdmin)<br>
>>><br>
>> With "git reflog", I've been able to get it back:<br>
>> git checkout -b memory 972e038<br>
>><br>
>> What do you have in mind?<br>
>><br>
>> Hugues.<br>
>><br>
><br>
> I did a simple test:<br>
> * run substr 100000 times<br>
> * run $obj->substr 100000 times (where $obj->substr simply calls substr)<br>
><br>
> The second one is 3 times longer than the first one. The simple fact to use<br>
> an object is too long.<br>
> I tried something else: overwrite the functions. It's better: 2 times<br>
> longer that the first one, but still slower…<br>
><br>
> That means that importing your file would take ~24 seconds instead of ~12<br>
> seconds.<br>
><br>
> Should we think about defining "pmaSubstr", "pmaStrlen", etc functions and<br>
> use it everywhere?<br>
<br>
</div></div>Do you mean using functions without objects?<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Marc Delisle (phpMyAdmin)</div></div></blockquote><div><br></div><div>That's it. Instead of using $pmaString->strlen or strlen, we could imagine to use pmaStrlen and this function would call strlen or mb_strlen if mb_* functions exist. </div><div>Another way could be to overwrite strlen with mb_strlen, but we wouldn't be able to use the original strlen if needed. So I think that we should define new functions.</div><div><br></div><div>I'll try to do a mass replacement and check if the execution time is better.</div><div><br></div><div>Hugues.</div></div></div></div>