[Phpmyadmin-devel] #4536 - master: import problem (PMA_String)

Marc Delisle marc at infomarc.info
Tue Sep 23 20:04:21 CEST 2014


Hugues Peccatte a écrit :
> 2014-09-23 16:23 GMT+02:00 Marc Delisle <marc at infomarc.info>:
> 
>> Hugues Peccatte a écrit :
>>> 2014-09-22 21:08 GMT+02:00 Hugues Peccatte <hugues.peccatte at gmail.com>:
>>>
>>>> 2014-09-22 18:44 GMT+02:00 Marc Delisle <marc at infomarc.info>:
>>>>> Hugues,
>>>>> do you still have the branch where each commit was separate, before
>>>>> squashing?
>>>>> --
>>>>> Marc Delisle (phpMyAdmin)
>>>>>
>>>> With "git reflog", I've been able to get it back:
>>>> git checkout -b memory 972e038
>>>>
>>>> What do you have in mind?
>>>>
>>>> Hugues.
>>>>
>>> I did a simple test:
>>> * run substr 100000 times
>>> * run $obj->substr 100000 times (where $obj->substr simply calls substr)
>>>
>>> The second one is 3 times longer than the first one. The simple fact to
>> use
>>> an object is too long.
>>> I tried something else: overwrite the functions. It's better: 2 times
>>> longer that the first one, but still slower…
>>>
>>> That means that importing your file would take ~24 seconds instead of ~12
>>> seconds.
>>>
>>> Should we think about defining "pmaSubstr", "pmaStrlen", etc functions
>> and
>>> use it everywhere?
>> Do you mean using functions without objects?
>>
>> --
>> Marc Delisle (phpMyAdmin)
>>
> 
> 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.
> 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.

What I don't like is that we would have two different syntaxes to call 
string functions. We would need comments in the calling code to explain 
why we are using a way and not another way.

> 
> I'll try to do a mass replacement and check if the execution time is better.
> 
> Hugues.


-- 
Marc Delisle (phpMyAdmin)




More information about the Developers mailing list