Discussion:
VMS benchmarks
(too old to reply)
Arne Vajhøj
2023-12-06 21:35:01 UTC
Permalink
Over the summer I made a number of posts with benchmark results
and code - some about compiler optimization and some about IO.

I decided to format it nicely and publish.

Result:

https://www.vajhoej.dk/arne/articles/vmsbm1.html
https://www.vajhoej.dk/arne/articles/vmsbm2.html

Arne
Simon Clubley
2023-12-07 13:28:40 UTC
Permalink
Post by Arne Vajhøj
Over the summer I made a number of posts with benchmark results
and code - some about compiler optimization and some about IO.
I decided to format it nicely and publish.
https://www.vajhoej.dk/arne/articles/vmsbm1.html
https://www.vajhoej.dk/arne/articles/vmsbm2.html
Your source code links don't work unless Javascript is enabled (and
enabled for a Google-owned domain). :-)

Simon.
--
Simon Clubley, ***@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.
Arne Vajhøj
2023-12-07 21:33:36 UTC
Permalink
Post by Simon Clubley
Post by Arne Vajhøj
Over the summer I made a number of posts with benchmark results
and code - some about compiler optimization and some about IO.
I decided to format it nicely and publish.
https://www.vajhoej.dk/arne/articles/vmsbm1.html
https://www.vajhoej.dk/arne/articles/vmsbm2.html
Your source code links don't work unless Javascript is enabled (and
enabled for a Google-owned domain). :-)
I use a bit of JavaScript and CSS.

That is a choice I have made.

I use jQuery from Google CDN.

I could use my own copy instead. I will do that.

Arne
Arne Vajhøj
2023-12-07 23:45:28 UTC
Permalink
Post by Arne Vajhøj
Post by Simon Clubley
Post by Arne Vajhøj
Over the summer I made a number of posts with benchmark results
and code - some about compiler optimization and some about IO.
I decided to format it nicely and publish.
https://www.vajhoej.dk/arne/articles/vmsbm1.html
https://www.vajhoej.dk/arne/articles/vmsbm2.html
Your source code links don't work unless Javascript is enabled (and
enabled for a Google-owned domain). :-)
I use a bit of JavaScript and CSS.
That is a choice I have made.
I use jQuery from Google CDN.
I could use my own copy instead. I will do that.
I have updated these two article to use my own copy of jquery.

Better?

If yes then I can update all the rest.

Arne
Simon Clubley
2023-12-08 13:18:07 UTC
Permalink
Post by Arne Vajhøj
I have updated these two article to use my own copy of jquery.
Better?
If yes then I can update all the rest.
Yes. Much better.

In addition to the primary benefit of avoiding the Google trackers, it
also means you, and not a third party, are in control of what gets
delivered to users of your website.

Simon.
--
Simon Clubley, ***@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.
Arne Vajhøj
2023-12-15 15:21:56 UTC
Permalink
Post by Arne Vajhøj
Over the summer I made a number of posts with benchmark results
and code - some about compiler optimization and some about IO.
I decided to format it nicely and publish.
https://www.vajhoej.dk/arne/articles/vmsbm1.html
I have updated with some Groovy numbers.

Rather impressive numbers.

Groovy out of the box is OK.

Groovy with the critical functions marked with @CompileStatic
(requires all variables to have an explicit type) performs great.

I think it is a pretty cool feature to be able to write
both traditional script style code without any explicit type
information and put explicit type information and an
annotation on a performance critical function to get
compiled language performance.
Post by Arne Vajhøj
https://www.vajhoej.dk/arne/articles/vmsbm2.html
Arne
Arne Vajhøj
2023-12-15 15:43:43 UTC
Permalink
Post by Arne Vajhøj
Post by Arne Vajhøj
https://www.vajhoej.dk/arne/articles/vmsbm1.html
I have updated with some Groovy numbers.
Rather impressive numbers.
Groovy out of the box is OK.
(requires all variables to have an explicit type) performs great.
I think it is a pretty cool feature to be able to write
both traditional script style code without any explicit type
information and put explicit type information and an
annotation on a performance critical function to get
compiled language performance.
Here are another test with some even more
impressive numbers.

And note this is stuff running on VMS x86-64 9.2-1 today.

C: 6.3 s, 6.3 s, 6.0 s, 4.1 s (depending on compiler and optimization)
Groovy script style : 51 s
Groovy with type declarations : 38 s
Groovy with type declarations and @CompileStatic : 3.5 s
Groovy calling Java code : 3.4 s

So one can write compact script code at a Python level
and get C performance of a performance critical function
by just declaring types explicit and put an annotation on.

Obviously do not conclude too much from a benchmark of
a function with one line of code.

Code and test output below.

Arne

$ type fib.c
#include <stdio.h>

#include "high_res_timer.h"

int fib(int n) {
return n < 2 ? n : fib(n - 1) + fib(n - 2);
}

static const int REP = 3;

int main()
{
printf("C:\n");
for(int i = 0; i < REP; i++)
{
TIMECOUNT_T t0 = GET_TIMECOUNT;
int ans = fib(45);
TIMECOUNT_T t1 = GET_TIMECOUNT;
printf("fib(45) = %d took %f seconds.\n", ans, (t1 - t0) * 1.0
/ UNITS_PER_SECOND);
}
return 0;
}

$ cc fib
$ link fib
$ run fib
C:
fib(45) = 1134903170 took 6.289937 seconds.
fib(45) = 1134903170 took 6.349937 seconds.
fib(45) = 1134903170 took 6.329937 seconds.
$ cc/opt=level:5 fib
$ link fib
$ run fib
C:
fib(45) = 1134903170 took 6.489935 seconds.
fib(45) = 1134903170 took 6.299937 seconds.
fib(45) = 1134903170 took 6.349937 seconds.
$ clang fib.c
$ link fib
$ run fib
C:
fib(45) = 1134903170 took 6.039940 seconds.
fib(45) = 1134903170 took 5.999940 seconds.
fib(45) = 1134903170 took 5.959940 seconds.
$ clang "-O3" fib.c
$ link fib
$ run fib
C:
fib(45) = 1134903170 took 4.049959 seconds.
fib(45) = 1134903170 took 4.089959 seconds.
fib(45) = 1134903170 took 4.079959 seconds.
$ type Fib.groovy
def fib1(n) {
return n < 2 ? n : fib1(n - 1) + fib1(n - 2)
}

int fib2(int n) {
return n < 2 ? n : fib2(n - 1) + fib2(n - 2)
}

@groovy.transform.CompileStatic
int fib3(int n) {
return n < 2 ? n : fib3(n - 1) + fib3(n - 2)
}

REP = 3

def test(lbl, f) {
println("${lbl}:")
for(i in 1..REP) {
t0 = System.currentTimeMillis()
ans = f(45)
t1 = System.currentTimeMillis()
println("fib(45) = ${ans} took ${(t1 - t0) / 1000.0} seconds.")
}
}

test("Groovy Python style", { n -> fib1(n) })
test("Groovy voluntary Java style", { n -> fib2(n) })
test("Groovy enforced Java style", { n -> fib3(n) })
j = new FibJ()
test("Java", { n -> j.fib4(n) })
$ type FibJ.java
public class FibJ {
public int fib4(int n) {
return n < 2 ? n : fib4(n - 1) + fib4(n - 2);
}
}
$ javac FibJ.java
$ groovy Fib.groovy
Groovy Python style:
fib(45) = 1134903170 took 55.379 seconds.
fib(45) = 1134903170 took 50.65 seconds.
fib(45) = 1134903170 took 50.549 seconds.
Groovy voluntary Java style:
fib(45) = 1134903170 took 41.21 seconds.
fib(45) = 1134903170 took 38.139 seconds.
fib(45) = 1134903170 took 38.24 seconds.
Groovy enforced Java style:
fib(45) = 1134903170 took 3.49 seconds.
fib(45) = 1134903170 took 3.53 seconds.
fib(45) = 1134903170 took 3.38 seconds.
Java:
fib(45) = 1134903170 took 3.75 seconds.
fib(45) = 1134903170 took 3.44 seconds.
fib(45) = 1134903170 took 3.37 seconds.
Arne Vajhøj
2024-03-31 00:13:13 UTC
Permalink
Post by Arne Vajhøj
Over the summer I made a number of posts with benchmark results
and code - some about compiler optimization and some about IO.
I decided to format it nicely and publish.
https://www.vajhoej.dk/arne/articles/vmsbm1.html
Updated with measurement of release compilers. The release
compilers perform a lot better than the field test
compilers.
Post by Arne Vajhøj
https://www.vajhoej.dk/arne/articles/vmsbm2.html
Arne

Loading...