Giter VIP home page Giter VIP logo

llvm-benchmark's Introduction

llvm-benchmark

Benchmark that compiles llvm with clang to assess the speed of a compilation platform. It is multiplatform and has so far been tested in Linux (x86-64), FreeBSD (arm64) and MacOS (x86-64,M1).

How it works

There are four stages in the process:

  1. llvm-project: get the llvm source code with git
  2. llvm-bootstrap: do a first compilation of clang with the system's C and C++ compilers
  3. llvm: use the compiler from the previous stage to compile clang with itself
  4. benchmark: use the compiler from the previous stage to time the compilation of llvm, clang and flang-new

Each stage is a target in the Makefile, and can be targeted individually. If the make process is interrupted, when it is resumed it will restart from the beginning of the last stage that was not completed, rather than resume where it was interrupted.

Usage

Simply type make to go through all stages. This will use the platform default compilers, all the system's threads in stages 2 and 3, and 4 threads for the benchmark stage. On Linux the GNU compilers will be used by default, and on BSD and MacOS, clang will be used.

More control can be obtained by specifying some parameters:

  • TIMINGS can be used to change the file where timings are recorded. By default it is in timings.txt
  • THREADS can be used to change the number of compiler threads used in the benchmark stage

For example, to compile stage 2 with clang on Linux, and use 8 threads for the benchmark stage:

make THREADS=8

Sample results

See Results.md for some sample timings.

Notes

Currently, flang-new is not very mature, and its compilation requires a large amount of RAM. For this reason, you might have to lower the THREADS parameter to not exceed your available memory. flang-newis only compiled in the benchmark phase.

The make utility that comes with MacOS is currently 17 years old and is not compatible with this project. You will have to install a newer make, possibly from Homebrew or MacPort.

llvm-benchmark's People

Contributors

laurentchardon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.