Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.
This repository was archived by the owner on Nov 8, 2021. It is now read-only.

Testing performance #5

Open
Open

Description

@tevador

I have pushed a test release of the C++ generator.

You can build it yourself (instructions here) or download precompiled binaries from here. The precompiled binaries require AVX instruction set, so if your CPU doesn't support it, you have to build your own.

It consists of two binaries: randomjs (the generator) and xst (javascript engine).

It generates and executes 1000 programs and calculates Blake2b hashes of all outputs.

Post your performance numbers and CPU specs.

Xeon E3-1245 @3.7 GHz (Debian 9)

> ./randomjs
Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
Performance: 100.232 programs per second

Activity

  1. SChernykh commented on Jul 10, 2018

    @SChernykh
    Contributor

    Intel Core i7-7820X @ 3.6 GHz (Windows 10). Built all binaries (release build) myself.

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 129.94 programs per second
    
  2. JohannesLau commented on Jul 10, 2018

    @JohannesLau

    From precompiled binaries.
    Ryzen 1700x @ 3.4GHz Windows 10
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79 Performance: 86.3199 programs per second

  3. SChernykh commented on Jul 10, 2018

    @SChernykh
    Contributor

    Intel Core i7-7820X @ 3.6 GHz (Windows 10). Rebuilt all binaries using profile guided optimizations: 6.4% faster.

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 138.256 programs per second
    

    Edit: here are the precompiled binaries on the same PC

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 130.962 programs per second
    
  4. tevador commented on Jul 10, 2018

    @tevador
    OwnerAuthor

    Raspberry Pi 3 @ 1.2 GHz

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 13.9537 programs per second
    

    (Note: To build for ARM, the currently used SSE2 version of Blake2b must be replaced by the reference or NEON optimized version.)

  5. Cactii1 commented on Jul 10, 2018

    @Cactii1

    Core i7-4700HQ @ 2.4 GHz Windows 8.1 with 16gigs RAM

    ..\Wownero-Test>randomjs.exe
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 96.2629 programs per second

    ..\Wownero-Test>randomjs.exe
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 95.4948 programs per second

    ..\Wownero-Test>randomjs.exe
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 96.447 programs per second

    ..\Wownero-Test>randomjs.exe
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 94.1722 programs per second

    ..\Wownero-Test>randomjs.exe
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 99.5576 programs per second

  6. SChernykh commented on Jul 10, 2018

    @SChernykh
    Contributor

    @tevador Your precompiled binaries crash with exception code 0xC000001D (illegal instruction) on Pentium G5400 (Coffee Lake) because it doesn't support AVX. I had to recompile it with SSE2.

    Intel Core i5-3210M @ 2.9 GHz, precompiled binaries:

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 75.0907 programs per second
    

    Intel Core i5-3210M @ 2.9 GHz, my binaries with PGO:

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 84.095 programs per second
    

    Intel Pentium G5400 @ 3.7 GHz, my binaries without PGO:

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 109.548 programs per second
    

    Intel Pentium G5400 @ 3.7 GHz, my binaries with PGO:

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 116.807 programs per second
    
  7. tevador commented on Jul 10, 2018

    @tevador
    OwnerAuthor

    @SChernykh Yes, the precompiled binaries require AVX. I added a note to the original comment. I didn't realize there were still modern CPUs where Intel disables it.

    Do the profile guided optimizations work in general or just for these particular 1000 programs? You can run a different set of programs by modifying the block header template in main.cpp. It would be best to read the block template and nonce count from the command line, but I didn't have time to implement it yet.

  8. SChernykh commented on Jul 10, 2018

    @SChernykh
    Contributor

    @tevador 1000 programs (~10 seconds of CPU time) is a big enough sample set for PGO to work well. It optimizes C/C++ code on low level and only needs execution statistics - which branches are executed more often, which if are taken and which are not and so on. In my experience, PGO almost always gives some improvement.

  9. zpalmtree commented on Jul 10, 2018

    @zpalmtree

    Ryzen 1600 @ 3.6 GHz (Linux)

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 115.622 programs per second
    
  10. SChernykh commented on Jul 12, 2018

    @SChernykh
    Contributor

    Raspberry Pi 3 @ 1.2 GHz

    @tevador Was it 64 bit or 32 bit build? Are there any differences between 32 and 64 bit?

  11. tevador commented on Jul 12, 2018

    @tevador
    OwnerAuthor

    @SChernykh Ubuntu 16.04 armv7l (32bit). Haven't tested a 64bit build since the software support is still a bit lacking.

  12. SChernykh commented on Jul 15, 2018

    @SChernykh
    Contributor

    Ryzen 1700 @ 3.6 GHz, Windows 10 (original testing binaries)

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 92.7852 programs per second
    
  13. SChernykh commented on Jul 20, 2018

    @SChernykh
    Contributor

    Finally found a way to test it on 64-bit ARM - there are a number of cloud hosting providers that have ARM servers.

    OS: Ubuntu 18.04 LTS
    Compiler: g++ (Ubuntu 8-20180414-1ubuntu2) 8.0.1 20180414 (experimental) [trunk revision 259383]
    Processor: Cavium ThunderX 88XX @ 2GHz (aarch64)

    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 17.4324 programs per second
    
  14. tevador commented on Jul 20, 2018

    @tevador
    OwnerAuthor

    Interesting. The performance per clock seems to be significantly lower than Raspberry Pi 3 in 32-bit mode. Perhaps the CPU is an older model?

    Can you also test a 32-bit build of the executables? I think the compiler flag is -march=armv7.

  15. 7 remaining items

  16. Gingeropolous commented on Jul 30, 2018

    @Gingeropolous

    @SChernykh , are those optimizations to the code that will increase performance on any CPU? Or are they compile-time optimizations for the specs of the Ryzen?

    Also, I assume these current binaries are for 1 thread. Is there any limit (i.e., cpu cache size) needed for each thread, or will it be able to run per thread regardless of cache size?

  17. SChernykh commented on Jul 30, 2018

    @SChernykh
    Contributor

    @Gingeropolous These are algorithmic and C++ coding optimizations only. No assembly or compiler flags magic.

    Edit: as I understood, it's supposed to run 1 process per CPU core.
    Edit2: yes, my optimizations will work on any CPU.

  18. tevador commented on Jul 30, 2018

    @tevador
    OwnerAuthor

    @Gingeropolous The limited testing I've done shows basically linear scaling with the number of cores. I haven't tested the impact of SMT, so I'm not sure if Ryzen will mine faster with 8 or 16 threads.

    @SChernykh Are you are optimizing the XS engine or the JS generator? The generator takes only about ~6% of the time of one hash, so I'm not sure what optimizations can be done there. Can you push the code changes?

    The PoW is not final yet. I'm planning some changes to the EvalExpression to increase FPGA resistance, but I have a lot of work this summer, so I don't have time to continue at the moment.

  19. SChernykh commented on Jul 30, 2018

    @SChernykh
    Contributor

    @tevador Most optimizations are in the XS engine, the only thing that I changed in RandomJS binary is IPC communicaton with XS engine. Not sure I can make a pull request right now since some of my optimizations are Windows only for now (memory allocator for example).

  20. SChernykh commented on Jul 30, 2018

    @SChernykh
    Contributor

    I added #ifdef guards to my Windows-only pieces of code and could compile and run it in Ubuntu:

    osboxes@osboxes:~/RandomJS/src-cpp/bin$ ./randomjs 
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 177.983 programs per second
    

    It's even faster on virtual Linux machine without profile-guided optimizations than on real Windows with PGO. GCC compiler is superior! I'll prepare pull requests later today.

  21. SChernykh commented on Jul 30, 2018

    @SChernykh
    Contributor

    XS pull request: tevador/moddable#9
    RandomJS pull request: #7

  22. Gingeropolous commented on Jul 30, 2018

    @Gingeropolous

    @tevador ,

    The PoW is not final yet. I'm planning some changes to the EvalExpression to increase FPGA resistance, but I have a lot of work this summer, so I don't have time to continue at the moment.

    Sounds awesome. Could you possibly write out a rough sketch of the idea so someone else could pick up where you left off?

  23. tevador commented on Jul 30, 2018

    @tevador
    OwnerAuthor

    @SChernykh I have merged your code. Btw, I think we could avoid the call to atoi by prepending the program size as a 4-byte integer at the beginning rather than writing it in textual form.

    @Gingeropolous It still requires a lot of research. The problem is that currently, there is a large variation in the number of EvalExpressions executed per program (IIRC it varies from as little as 8 to hundreds). The goal is to have a narrow range.

    As I'm planning to remove the = from the eval chars, the low number of EvalExpressions would enable some theoretical attacks by assuming all EvalExpressions throw a SyntaxError and thus avoiding eval altogether.

    The programs with a high number of EvalExpressions create long-running outliers, which is also undesirable. Throw/catch is slow and could be a potential optimization target.

  24. miziel commented on Jul 31, 2018

    @miziel

    i5-6600K @ 4.1 GHz , Windows 10, pre-compiled binaries

    Performance: 123.777 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 123.409 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 123.018 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 121.82 programs per second
    

    ryzen 2700x @ 4.0 GHz, Windows 10, pre-compiled binaries

    Performance: 102.023 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 101.123 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 102.32 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 100.887 programs per second
    
  25. M5M400 commented on Jul 31, 2018

    @M5M400

    New results with latest optimizations by @SChernykh

    Same Threadripper did ~123 pps before :)

    root@TR4:/usr/local/src/RandomJS/src-cpp/bin# for i in {1..10}; do ./randomjs; done
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 193.575 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 193.213 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 194.454 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 192.792 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 193.737 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 193.869 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 193.833 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 192.676 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 193.936 programs per second
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 194.189 programs per second
    
  26. Gingeropolous commented on Aug 5, 2018

    @Gingeropolous

    when I try to compile the new code, I get segfaults... but only on one box. O got it to compile on a different box and it runs fine.

    New optimizations:
    model name : AMD Opteron(tm) Processor 6172
    Cumulative output hash: bb3bffd3d0eef49066bf5c8e664c082c502fe021a7cdc0cd0c44fe1990560b79
    Performance: 60.5453 programs per second

    won't compile on model name : Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz , even though I followed the same instructions. Interestingly, the precompiled binaries run on this machine, but not the opteron.

  27. SChernykh commented on Aug 5, 2018

    @SChernykh
    Contributor

    You get segfaults during compilation or when you try to run the compiled binary?

  28. Gingeropolous commented on Aug 5, 2018

    @Gingeropolous

    @SChernykh , when I tried to run the self-compiled binary (on the i7-7700k box), i get a segfault (but the precompiled binary you provided works fine on that box).

    When I try to run the precompiled binary on the Opteron 6172, i get Illegal instruction (core dumped)

  29. OpticFlowX commented on Aug 6, 2018

    @OpticFlowX

    Hi, is it possible to provide binaries for older architectures? Like Intel Core2 for example (-march=core2 on gcc)? Or AVX is a must-have?

  30. ouillepouille commented on Oct 4, 2018

    @ouillepouille

    on ubuntu 18.10 I compiled xst and randomjs... they compiled fine but xst fails to run
    So ./randomjs does nothing (you have to kill it)
    I'm on a ThinkPad X240 with i5

    ./xst
    Segmentation error (core dumped)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions