No Support > Scheduled for cpg1.5.x
[Done]: [Suggestion for code review] get rid of the slow ereg(i) and ereg_replace
Joachim Müller:
--- Quote from: ripat on July 12, 2007, 02:51:48 pm ---OK. There are quite a number of changes. That will be a long post.
--- End quote ---
Doesn't matter - as long as there is good content, we don't mind long postings. And yours is good and valid content :)
--- Quote from: ripat on July 12, 2007, 02:51:48 pm ---Is it OK with this link?
--- End quote ---
That's OK just as well. Whatever option you prefer.
Joachim
ripat:
Well I went through all 1.5.x files that contained ereg() functions and made the changes accordingly. I skipped all files from directory include/.svn/text-base/ that seem to be duplicated from main include/
All changes are here:
text mode: http://www.lumadis.be/jeanluc/vault/cpg15x_txt.php
or
colorized: http://www.lumadis.be/jeanluc/vault/cpg15x_col.php
I still have to check a couple of things. Should be done tomorrow. Also, I have no test script to test the impact of the changes on the application as a whole. It should be no problem as it is quite straight forward to replace ereg by preg_match. Optimization of the pattern for speed is another story. Took me some time...
Of course when I quote a speed gain of, say 10 times faster, it is for the block of code that contains the ereg() function - not for the whole script. But as we say over here "les petits ruisseaux font les grandes rivières" (small streams make the large rivers).
A+
JL
Nibbler:
Committed to 1.5.
Navigation
[0] Message Index
[*] Previous page
Go to full version