[Include] [INC] strlib v1.3 - Simple string modification (Update: 21/10/09)
#12

...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.

Код:
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
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):

Код:
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
Reply


Messages In This Thread
[INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Westie - 09.07.2009, 02:01
Re: [INC] strlib - Simple string modification - by Chaprnks - 09.07.2009, 02:27
Re: [INC] strlib - Simple string modification - by NeRoSiS - 09.07.2009, 07:26
Re: [INC] strlib - Simple string modification - by Westie - 09.07.2009, 14:51
Re: [INC] strlib - Simple string modification - by Correlli - 09.07.2009, 15:04
Re: [INC] strlib - Simple string modification - by GTA_Rules - 10.07.2009, 19:46
Re: [INC] strlib - Simple string modification - by yezizhu - 19.07.2009, 10:53
Re: [INC] strlib - Simple string modification - by James_Alex - 19.07.2009, 19:06
Re: [INC] strlib - Simple string modification - by Westie - 27.07.2009, 00:06
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by GTA_Rules - 27.07.2009, 15:29
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by Marcel - 27.07.2009, 16:21
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by Westie - 27.07.2009, 17:36
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by Brendan_Thomson - 18.08.2009, 12:28
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by Dabombber - 21.08.2009, 05:40
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by nuriel8833 - 21.08.2009, 07:29
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by Brendan_Thomson - 21.08.2009, 09:06
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by Brendan_Thomson - 05.09.2009, 15:35
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by Westie - 13.09.2009, 10:09
Re: [INC] strlib - Simple string modification (Update: 27/07/09) - by Calgon - 13.09.2009, 10:15
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Westie - 21.10.2009, 21:42
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by MenaceX^ - 21.10.2009, 21:51
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Kyeno - 21.12.2009, 11:34
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by _Gangster_ - 21.12.2009, 11:49
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by GTA_Rules - 22.12.2009, 09:54
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by GreenHammy - 03.01.2010, 09:20
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Puffmac - 09.01.2010, 19:06
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by mario713 - 09.02.2010, 00:23
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Calgon - 09.02.2010, 01:34
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Westie - 09.02.2010, 15:33
AW: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Meta - 16.11.2010, 21:08
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Grim_ - 16.11.2010, 21:10
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Luka P. - 16.11.2010, 21:41
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Donya - 06.04.2011, 17:53
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Minokon - 06.04.2011, 17:59
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Ironboy - 19.04.2011, 05:00
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Westie - 19.06.2011, 18:24
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by clavador - 20.03.2012, 20:54
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by ikkentim - 10.04.2012, 18:51
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by QTSwift - 10.09.2013, 06:17
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Emre__ - 19.08.2014, 01:40
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by ball - 16.05.2018, 12:39
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Yousha - 16.05.2018, 12:46
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Kar - 16.05.2018, 14:16
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Yousha - 17.05.2018, 17:02
Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - by Yousha - 19.05.2018, 08:18

Forum Jump:


Users browsing this thread: 1 Guest(s)