In a previous thread about comparing PB to C for speed, a request
was made for some good benchmark code.
I wrote a Benchmark for PB (DDT) and also ported it to VB 5.0
to compare the benchmarks of each.
Since, VB uses a C compiler in the backend for Native code
compiling, the benchmarks for VB (Native code) should be
similiar to a C compiler.
I ran the test on a 686 CPU at 200 MHZ.
The first test I ran, I compiled the VB app to native code
and only used the "compile for fast code" option :
The values below are approximately the lowest value after running
the test multiple times.
There are two Benchmarks:
(1) More math intensive
(2) More string intensive
*** To give VB a better chance, I compiled the VB app
again and this time I turned off "every single safety check"
possible so the compiled code ran as fast is possible.
The results :
When VB compiled using "normal" safety checks,
PB was 32% faster (Benchmark 1)
PB was 220% faster (Benchmark 2)
When VB compiled with "every safety check off",
VB was a tiny 5.8% faster than PB (Benchmark 1)
PB was again 222% faster (Benchmark 2)
The code I wrote was designed to prevent the compiler
from making easy "shortcuts" to make the code faster.
The tests seem to demonstrate a realworld comparison
of VB and PB !
------------------
was made for some good benchmark code.
I wrote a Benchmark for PB (DDT) and also ported it to VB 5.0
to compare the benchmarks of each.
Since, VB uses a C compiler in the backend for Native code
compiling, the benchmarks for VB (Native code) should be
similiar to a C compiler.
I ran the test on a 686 CPU at 200 MHZ.
The first test I ran, I compiled the VB app to native code
and only used the "compile for fast code" option :
The values below are approximately the lowest value after running
the test multiple times.
There are two Benchmarks:
(1) More math intensive
(2) More string intensive
Code:
[b] VB 5.0 PB DLL 6.0 --------------------------------------------- Benchmark 1 - 13.1 secs 9.88 secs Benchmark 2 - 17.12 secs 5.33 secs --------------------------------------------- [/b]
*** To give VB a better chance, I compiled the VB app
again and this time I turned off "every single safety check"
possible so the compiled code ran as fast is possible.
Code:
[b] VB 5.0 *** PB DLL 6.0 --------------------------------------------- Benchmark 1 - 9.33 secs 9.88 secs Benchmark 2 - 17.18 secs 5.33 secs --------------------------------------------- [/b]
The results :
When VB compiled using "normal" safety checks,
PB was 32% faster (Benchmark 1)
PB was 220% faster (Benchmark 2)
When VB compiled with "every safety check off",
VB was a tiny 5.8% faster than PB (Benchmark 1)
PB was again 222% faster (Benchmark 2)
The code I wrote was designed to prevent the compiler
from making easy "shortcuts" to make the code faster.
The tests seem to demonstrate a realworld comparison
of VB and PB !
------------------
Comment