• VMS benchmarks

    From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Wed Dec 6 16:35:01 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Thu Dec 7 13:28:40 2023
    On 2023-12-06, Arne Vajhj <arne@vajhoej.dk> wrote:
    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


    Your source code links don't work unless Javascript is enabled (and
    enabled for a Google-owned domain). :-)

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Thu Dec 7 16:33:36 2023
    On 12/7/2023 8:28 AM, Simon Clubley wrote:
    On 2023-12-06, Arne Vajhøj <arne@vajhoej.dk> wrote:
    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

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Thu Dec 7 18:45:28 2023
    On 12/7/2023 4:33 PM, Arne Vajhøj wrote:
    On 12/7/2023 8:28 AM, Simon Clubley wrote:
    On 2023-12-06, Arne Vajhøj <arne@vajhoej.dk> wrote:
    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

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Fri Dec 8 13:18:07 2023
    On 2023-12-07, Arne Vajhj <arne@vajhoej.dk> wrote:

    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, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Fri Dec 15 10:21:56 2023
    On 12/6/2023 4:35 PM, Arne Vajhøj wrote:
    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

    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.

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

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Fri Dec 15 10:43:43 2023
    On 12/15/2023 10:21 AM, Arne Vajhøj wrote:
    On 12/6/2023 4:35 PM, Arne Vajhøj wrote:
    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.

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Sat Mar 30 20:13:13 2024
    On 12/6/2023 4:35 PM, Arne Vajhøj wrote:
    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

    Updated with measurement of release compilers. The release
    compilers perform a lot better than the field test
    compilers.

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

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)