Board index » delphi » Fastcode IntToStr B&V v0.19

Fastcode IntToStr B&V v0.19


2005-09-14 05:07:18 PM
delphi243
Released in attachments.
Changes:
- Should be Delphi 5 compatible
- Worst spread separately displayed in report
- Some small bugfixes
 
 

Re:Fastcode IntToStr B&V v0.19

On 14 Sep 2005 02:07:18 -0700, "Avatar Zondertau" <XXXX@XXXXX.COM
(please reply to newsgroup)>writes:
Quote
- Should be Delphi 5 compatible
Confirmed. Compiles with no changes.
--
Anders Isaksson, Sweden
BlockCAD: web.telia.com/~u16122508/proglego.htm
Gallery: web.telia.com/~u16122508/gallery/index.htm
 

Re:Fastcode IntToStr B&V v0.19

Hi
With FastMM4
Worst spread: 10,4%
Benchmark report
Compiler: Delphi
CPU: AMD Opteron(tm) 64 Processor 240 (AuthenticAMD, type 0, family
00F, model 05, stepping 1), 1400,0 MHz
Generated on: 15-09-2005 10:14:34
Windows: Windows XP (NT.5.1.2600)
Benchmark report for IntToStr challenge (B&V version 0.19)
Name Align Spread SubBench1 Benchmark
---- ----- ------ --------- ---------
IntToStr_JOH_IA32_4 8 2,0% 805 805
IntToStr_JOH_IA32_4 8 2,0% 805 805
IntToStr_JOH_IA32_4 8 2,0% 806 806
IntToStr_JOH_IA32_4 8 2,0% 806 806
IntToStr_JOH_IA32_4 8 2,0% 806 806
IntToStr_JOH_IA32_4 8 2,0% 809 809
IntToStr_JOH_IA32_4 8 2,0% 824 824
IntToStr_JOH_IA32_4 8 2,0% 824 824
IntToStr_JOH_IA32_4 8 2,0% 825 825
IntToStr_JOH_IA32_4 8 2,0% 830 830
IntToStr_JOH_PAS_4 C 10,4% 1321 1321
IntToStr_JOH_PAS_4 C 10,4% 1331 1331
IntToStr_JOH_PAS_4 C 10,4% 1334 1334
IntToStr_JOH_PAS_4 C 10,4% 1340 1340
IntToStr_JOH_PAS_4 C 10,4% 1341 1341
IntToStr_JOH_PAS_4 C 10,4% 1341 1341
IntToStr_JOH_PAS_4 C 10,4% 1346 1346
IntToStr_JOH_PAS_4 C 10,4% 1361 1361
IntToStr_JOH_PAS_4 C 10,4% 1491 1491
IntToStr_JOH_PAS_4 C 10,4% 1515 1515
IntToStr_AZ_Pas_1 8 0,5% 1584 1584
IntToStr_AZ_Pas_1 8 0,5% 1589 1589
IntToStr_AZ_Pas_1 8 0,5% 1590 1590
IntToStr_AZ_Pas_1 8 0,5% 1590 1590
IntToStr_AZ_Pas_1 8 0,5% 1590 1590
IntToStr_AZ_Pas_1 8 0,5% 1590 1590
IntToStr_AZ_Pas_1 8 0,5% 1593 1593
IntToStr_AZ_Pas_1 8 0,5% 1596 1596
IntToStr_AZ_Pas_1 8 0,5% 1597 1597
IntToStr_AZ_Pas_1 8 0,5% 1597 1597
IntToStrOuc_IA32_2 4 0,5% 2335 2335
IntToStrOuc_IA32_2 4 0,5% 2337 2337
IntToStrOuc_IA32_2 4 0,5% 2342 2342
IntToStrOuc_IA32_2 4 0,5% 2344 2344
IntToStrOuc_IA32_2 4 0,5% 2345 2345
IntToStrOuc_IA32_2 4 0,5% 2345 2345
IntToStrOuc_IA32_2 4 0,5% 2346 2346
IntToStrOuc_IA32_2 4 0,5% 2351 2351
IntToStrOuc_IA32_2 4 0,5% 2354 2354
IntToStrOuc_IA32_2 4 0,5% 2356 2356
IntToStr_SZ_PAS_2 4 2,1% 2793 2793
IntToStr_SZ_PAS_2 4 2,1% 2803 2803
IntToStr_SZ_PAS_2 4 2,1% 2815 2815
IntToStr_SZ_PAS_2 4 2,1% 2841 2841
IntToStr_SZ_PAS_2 4 2,1% 2864 2864
IntToStr_SZ_PAS_2 4 2,1% 2867 2867
IntToStr_SZ_PAS_2 4 2,1% 2877 2877
IntToStr_SZ_PAS_2 4 2,1% 2884 2884
IntToStr_SZ_PAS_2 4 2,1% 2891 2891
IntToStr_SZ_PAS_2 4 2,1% 2895 2895
IntToStr_AI_PAS_12 0 2,2% 3036 3036
IntToStr_AI_PAS_12 0 2,2% 3073 3073
IntToStr_AI_PAS_12 0 2,2% 3083 3083
IntToStr_AI_PAS_12 0 2,2% 3088 3088
IntToStr_AI_PAS_12 0 2,2% 3103 3103
IntToStr_AI_PAS_12 0 2,2% 3104 3104
IntToStr_AI_PAS_12 0 2,2% 3120 3120
IntToStr_AI_PAS_12 0 2,2% 3122 3122
IntToStr_AI_PAS_12 0 2,2% 3139 3139
IntToStr_AI_PAS_12 0 2,2% 3157 3157
IntToStr_DKC_Pas_5 8 3,9% 3842 3842
IntToStr (RTL) C 7,3% 3844 3844
IntToStr_DKC_Pas_5 8 3,9% 3891 3891
IntToStr_DKC_Pas_5 8 3,9% 3961 3961
IntToStr_DKC_Pas_5 8 3,9% 3987 3987
IntToStr_DKC_Pas_5 8 3,9% 3991 3991
IntToStr_DKC_Pas_5 8 3,9% 3992 3992
IntToStr (RTL) C 7,3% 4020 4020
IntToStr_DKC_Pas_5 8 3,9% 4024 4024
IntToStr_DKC_IA32_3 4 5,1% 4033 4033
IntToStr (RTL) C 7,3% 4085 4085
IntToStr_DKC_Pas_5 8 3,9% 4086 4086
IntToStr (RTL) C 7,3% 4087 4087
IntToStr (RTL) C 7,3% 4089 4089
IntToStr_DKC_Pas_5 8 3,9% 4091 4091
IntToStr_DKC_Pas_5 8 3,9% 4128 4128
IntToStr (RTL) C 7,3% 4148 4148
IntToStr_DKC_IA32_3 4 5,1% 4156 4156
IntToStr_DKC_IA32_3 4 5,1% 4157 4157
IntToStr (RTL) C 7,3% 4196 4196
IntToStr_DKC_IA32_3 4 5,1% 4226 4226
IntToStr (RTL) C 7,3% 4232 4232
IntToStr_DKC_IA32_3 4 5,1% 4261 4261
IntToStr_LBG_PAS_1 8 1,1% 4267 4267
IntToStr_LBG_PAS_1 8 1,1% 4267 4267
IntToStr_LBG_PAS_1 8 1,1% 4270 4270
IntToStr_LBG_PAS_1 8 1,1% 4271 4271
IntToStr_LBG_PAS_1 8 1,1% 4273 4273
IntToStr_LBG_PAS_1 8 1,1% 4273 4273
IntToStr_LBG_PAS_1 8 1,1% 4276 4276
IntToStr_LBG_PAS_1 8 1,1% 4278 4278
IntToStr_LBG_PAS_1 8 1,1% 4280 4280
IntToStr_DKC_IA32_3 4 5,1% 4293 4293
IntToStr_DKC_IA32_3 4 5,1% 4309 4309
IntToStr_LBG_PAS_1 8 1,1% 4324 4324
IntToStr_DKC_IA32_3 4 5,1% 4330 4330
IntToStr_DKC_IA32_3 4 5,1% 4346 4346
IntToStr (RTL) C 7,3% 4362 4362
IntToStr_DKC_IA32_3 4 5,1% 4383 4383
IntToStr (RTL) C 7,3% 4414 4414
 

Re:Fastcode IntToStr B&V v0.19

Hi Avatar
Is this line
SetLength(SBRA, Challenge.BenchmarkCount);
necessary to call every time the benchmark is run?
Best regards
Dennis
 

Re:Fastcode IntToStr B&V v0.19

Hi Avatar
This one is only needed once when the B&V is loaded
Win32Check(QueryPerformanceFrequency(TimeFreq));
Best regards
Dennis
 

Re:Fastcode IntToStr B&V v0.19

Hi
Why do you call
Win32Check(QueryPerformanceFrequency(TimeFreq));
Win32Check(QueryPerformanceCounter(TimeStart));
when you use
TicksStart := RdTsc;
?
Best regards
Dennis
 

Re:Fastcode IntToStr B&V v0.19

Hi Avatar
The number of reruns is set at compile time?
This one calls the MM once per benchmark start
SetLength(DurationArray, RERUN_COUNT - RERUN_TRIM_FIRST);
and is only needed once at application load?
Best regards
Dennis
 

Re:Fastcode IntToStr B&V v0.19

Quote
Is this line

SetLength(SBRA, Challenge.BenchmarkCount);

necessary to call every time the benchmark is run?
Yes. These arrays keep track of the subbenchmark results. Since they
are stored it is not possible to re-use the same array each time.
 

Re:Fastcode IntToStr B&V v0.19

Quote
This one is only needed once when the B&V is loaded

Win32Check(QueryPerformanceFrequency(TimeFreq));
Ok, i made it like that now. I don't think it will have a significant
effect.
 

Re:Fastcode IntToStr B&V v0.19

Quote
Is this line

SetLength(SBRA, Challenge.BenchmarkCount);

necessary to call every time the benchmark is run?
I could do all dynamic memory allocation during benchmakring (mostly
for storing results) using the Windows API directly. Do you think that
may help?
 

Re:Fastcode IntToStr B&V v0.19

Quote
Win32Check(QueryPerformanceFrequency(TimeFreq));
Win32Check(QueryPerformanceCounter(TimeStart));

when you use

TicksStart := RdTsc;

?
I use RdTsc to measure the function execution time in the number of
clock ticks. The advantage is that RdTsc executes faster and has higher
resolution than QueryPerformanceCounter.
I then use the performance counter to calculate the result back to a
time-related measurement, since benchmarks have always been based on
time - not clockticks - before.
I could remove it if you think that would be better.
 

Re:Fastcode IntToStr B&V v0.19

Quote
The number of reruns is set at compile time?

This one calls the MM once per benchmark start

SetLength(DurationArray, RERUN_COUNT - RERUN_TRIM_FIRST);

and is only needed once at application load?
Well spotted. It will be static in the next release.
 

Re:Fastcode IntToStr B&V v0.19

Quote
The number of reruns is set at compile time?

This one calls the MM once per benchmark start

SetLength(DurationArray, RERUN_COUNT - RERUN_TRIM_FIRST);

and is only needed once at application load?
Actually IntToStrData can also be pre-allocated, though it cannot be on
the stack (too big).
 

Re:Fastcode IntToStr B&V v0.19

Hi
Quote
I could do all dynamic memory allocation during benchmakring (mostly
for storing results) using the Windows API directly. Do you think that
may help?
No.
Why do you "store" them?
Best regards
Dennis
 

Re:Fastcode IntToStr B&V v0.19

Quote
>I could do all dynamic memory allocation during benchmakring (mostly
>for storing results) using the Windows API directly. Do you think
>that may help?

No.

Why do you "store" them?
To be able to later report them.