27.07.2009, 17:36
...except it's a lot faster than strtok.
Testing explode()
My first test was to test the speeds of various functions to do with exploding strings. explode() and explodea() are both written by me, and they are very similar, except explodea() is slightly more complex. On the other hand, split() is a function found in GF-RP, and seeing as that is one of the most popular game modes (and the most hated, by me), I thought I should include it. Also, for fair comparison, I used ysi_explode(), this function was renamed from explode(), and this can be found in YSI.
As you can see, using explode() has a lot of savings. These new versions are even faster than the 'inefficient' previous core, which were miles faster than the other functions anyway. 
Testing str_replace()
I used my str_replace() function, and compared it to the one that is in dUtils, as well as the one found from here (Dabombber):
Testing explode()
My first test was to test the speeds of various functions to do with exploding strings. explode() and explodea() are both written by me, and they are very similar, except explodea() is slightly more complex. On the other hand, split() is a function found in GF-RP, and seeing as that is one of the most popular game modes (and the most hated, by me), I thought I should include it. Also, for fair comparison, I used ysi_explode(), this function was renamed from explode(), and this can be found in YSI.
Код:
explode(): 0860, explodea(): 0828, split(): 2187, ysi_explode(): 1922 explode(): 0766, explodea(): 0812, split(): 2156, ysi_explode(): 1875 explode(): 0735, explodea(): 0797, split(): 2187, ysi_explode(): 1875 explode(): 0719, explodea(): 0828, split(): 2172, ysi_explode(): 1859 explode(): 0735, explodea(): 0812, split(): 2891, ysi_explode(): 2531

Testing str_replace()
I used my str_replace() function, and compared it to the one that is in dUtils, as well as the one found from here (Dabombber):
Код:
str_replace(): 0266, dutils_strreplace(): 7125, dabombber_strreplace(): 0516 str_replace(): 0266, dutils_strreplace(): 6625, dabomber_strreplace(): 0484 str_replace(): 0266, dutils_strreplace(): 6328, dabomber_strreplace(): 0500 str_replace(): 0282, dutils_strreplace(): 6078, dabomber_strreplace(): 0515 str_replace(): 0266, dutils_strreplace(): 6703, dabomber_strreplace(): 0500