Notes

Umesh

Umesh's Notes

Umesh

Umesh

February 26 2016
Observation: preg_replace_callback is much faster than preg_replace function
Rastin Mehr
Rastin Mehr
February 26 2016 Permalink
Where did you see that?
Umesh
Umesh
February 27 2016 Permalink
@Rastin .. During Anahita 4.x testing I realized that performance is bit slow .. I thought it must be because of regex usage for hashtag as well as regex usage in my other functions in views. One of the stackoverflow discussion suggested use of preg_replace_callback. I wrote a small test stub and found that callback is indeed faster.

preg_replace is anyway deprecated in PHP 5.5
Rastin Mehr liked this
Rastin Mehr
Rastin Mehr
February 27 2016 Permalink
Good point, will you be able to update the code and do a PR? I haven't tagged the 4.2.0 Birth release yet.
Umesh
Umesh
February 27 2016 Permalink
@Rastin .. I'm still not comfortable with the entire process of git PR. Let me try it today
Rastin Mehr
Rastin Mehr
February 27 2016 Permalink
just fork the master branch to your account, apply the fixes, then create a pull request. It will stay in pending mode until I test and accept it. Start with a very small fix first such as the hashtag plugin.
Rajkumar Mundel liked this

Powered by Anahita