[TYPO3-core] RFC #15020: Enhancement of t3lib_div::testInt
Ernesto Baschny [cron IT]
ernst at cron-it.de
Fri Sep 10 11:36:16 CEST 2010
Helmut Hummel schrieb am 10.09.2010 09:05:
> On 12.08.10 22:10, Steffen Kamper wrote:
>> Committed patch an test to svn
>> 4_4 rev 8585
>> trunk rev 8586
>
> As discussed on the dev list, this introduces a different behaviour and
> also bugs because other parts of the core rely on the old behaviour.
>
> Find attached a patch that restores the behaviour, while still beeing
> slightly faster (and more readable) along with updated unit tests
> reflecting the necessities.
>
> Additionally I added the modiefied script for testing performance.
Thanks Helmut! Here are my results (I also added the current wrong trunk
behaviour, so that we can compare):
- - - - - - - - - - - - - - - - - - - - - - - -
int
original TRUE : 2.146
variantTrunk TRUE : 1.635 gain 31.2 %
variant1 TRUE : 1.734 gain 23.7 %
variant2 TRUE : 1.717 gain 25.0 %
variant3 TRUE : 2.253 gain -4.8 %
negative int
original TRUE : 2.158
variantTrunk TRUE : 1.656 gain 30.3 %
variant1 TRUE : 1.762 gain 22.4 %
variant2 TRUE : 1.763 gain 22.4 %
variant3 TRUE : 2.263 gain -4.6 %
largest int
original TRUE : 2.134
variantTrunk TRUE : 1.632 gain 30.7 %
variant1 TRUE : 1.716 gain 24.3 %
variant2 TRUE : 1.720 gain 24.0 %
variant3 TRUE : 2.252 gain -5.3 %
int as string
original TRUE : 2.136
variantTrunk TRUE : 1.694 gain 26.1 %
variant1 TRUE : 1.787 gain 19.5 %
variant2 TRUE : 1.760 gain 21.3 %
variant3 TRUE : 2.284 gain -6.5 %
negative int as string
original TRUE : 2.165
variantTrunk TRUE : 1.692 gain 28.0 %
variant1 TRUE : 1.778 gain 21.8 %
variant2 TRUE : 1.776 gain 21.9 %
variant3 TRUE : 2.315 gain -6.5 %
zero
original TRUE : 2.140
variantTrunk TRUE : 1.614 gain 32.6 %
variant1 TRUE : 1.690 gain 26.6 %
variant2 TRUE : 1.692 gain 26.5 %
variant3 TRUE : 2.220 gain -3.6 %
zero as string
original TRUE : 2.090
variantTrunk TRUE : 1.629 gain 28.4 %
variant1 TRUE : 1.742 gain 20.0 %
variant2 TRUE : 1.729 gain 20.9 %
variant3 TRUE : 2.292 gain -8.8 %
int as string with leading zero
original FALSE : 2.103
variantTrunk TRUE : 1.654 gain 27.1 %
variant1 FALSE : 1.745 gain 20.5 %
variant2 FALSE : 1.753 gain 19.9 %
variant3 FALSE : 2.295 gain -8.4 %
positive int as string with plus modifier
original FALSE : 2.162
variantTrunk TRUE : 1.657 gain 30.5 %
variant1 FALSE : 1.766 gain 22.4 %
variant2 FALSE : 1.715 gain 26.1 %
variant3 FALSE : 2.287 gain -5.5 %
negative int as string with leading zero
original FALSE : 2.150
variantTrunk TRUE : 1.713 gain 25.4 %
variant1 FALSE : 1.783 gain 20.6 %
variant2 FALSE : 1.770 gain 21.4 %
variant3 FALSE : 2.310 gain -6.9 %
largest int plus one
original FALSE : 2.658
variantTrunk FALSE : 1.650 gain 61.1 %
variant1 FALSE : 2.246 gain 18.3 %
variant2 FALSE : 2.230 gain 19.2 %
variant3 FALSE : 2.771 gain -4.1 %
string
original FALSE : 2.116
variantTrunk FALSE : 1.640 gain 29.0 %
variant1 FALSE : 1.739 gain 21.7 %
variant2 FALSE : 1.722 gain 22.9 %
variant3 FALSE : 2.179 gain -2.9 %
empty string
original FALSE : 2.075
variantTrunk FALSE : 1.618 gain 28.2 %
variant1 FALSE : 0.862 gain 140.8 %
variant2 FALSE : 0.848 gain 144.7 %
variant3 FALSE : 0.852 gain 143.4 %
int in string
original FALSE : 2.093
variantTrunk FALSE : 1.665 gain 25.7 %
variant1 FALSE : 1.742 gain 20.1 %
variant2 FALSE : 1.713 gain 22.1 %
variant3 FALSE : 2.248 gain -6.9 %
int as string with space after
original FALSE : 2.098
variantTrunk FALSE : 1.667 gain 25.9 %
variant1 FALSE : 1.737 gain 20.8 %
variant2 FALSE : 1.704 gain 23.2 %
variant3 FALSE : 2.255 gain -6.9 %
int as string with space before
original FALSE : 2.095
variantTrunk TRUE : 1.637 gain 28.0 %
variant1 FALSE : 1.737 gain 20.6 %
variant2 FALSE : 1.701 gain 23.1 %
variant3 FALSE : 2.241 gain -6.5 %
int as string with many spaces before
original FALSE : 2.103
variantTrunk TRUE : 1.657 gain 26.9 %
variant1 FALSE : 1.739 gain 20.9 %
variant2 FALSE : 1.711 gain 22.9 %
variant3 FALSE : 2.236 gain -5.9 %
float
original FALSE : 2.365
variantTrunk FALSE : 1.588 gain 48.9 %
variant1 FALSE : 1.958 gain 20.7 %
variant2 FALSE : 1.941 gain 21.8 %
variant3 FALSE : 2.488 gain -5.0 %
float as string
original FALSE : 2.099
variantTrunk FALSE : 1.714 gain 22.5 %
variant1 FALSE : 1.739 gain 20.8 %
variant2 FALSE : 1.702 gain 23.3 %
variant3 FALSE : 2.251 gain -6.8 %
float as string only a dot
original FALSE : 2.106
variantTrunk TRUE : 1.717 gain 22.6 %
variant1 FALSE : 1.748 gain 20.4 %
variant2 FALSE : 1.720 gain 22.4 %
variant3 FALSE : 2.252 gain -6.5 %
float as string trailing zero would evaluate to int 10
original FALSE : 2.101
variantTrunk TRUE : 1.726 gain 21.8 %
variant1 FALSE : 1.739 gain 20.8 %
variant2 FALSE : 1.704 gain 23.3 %
variant3 FALSE : 2.258 gain -6.9 %
float as string trailing zeros would evaluate to int 10
original FALSE : 2.101
variantTrunk TRUE : 1.725 gain 21.8 %
variant1 FALSE : 1.745 gain 20.4 %
variant2 FALSE : 1.705 gain 23.3 %
variant3 FALSE : 2.254 gain -6.8 %
null
original FALSE : 2.057
variantTrunk FALSE : 1.528 gain 34.6 %
variant1 FALSE : 1.646 gain 25.0 %
variant2 FALSE : 1.659 gain 24.0 %
variant3 FALSE : 2.136 gain -3.7 %
- - - - - - - - - - - - - - - - - - - - - - - -
So I conclude that variant2 is ok and that it in average provides the
most average speed improvement. And the bar is green again with that
change. +1 from my side on that change (attached patch for trunk, the
unit tests from Helmut are perfect).
Or should we go with variant 1, as Helmut suggested? Maybe others can
repeat the test.
Cheers,
Ernesto
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 15020_followup-v2.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100910/6e49d09a/attachment.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100910/6e49d09a/attachment.htm>
More information about the TYPO3-team-core
mailing list