Code Monkey home page Code Monkey logo

mypyc-benchmarks's Introduction

mypyc benchmarks

This is a collection of mypyc benchmarks. They are intended to track performance of mypyc against interpreted CPython. They are also useful for validating that a mypyc enhancement results in a measurable performance improvement.

Some benchmarks are microbenchmarks that are only useful for finding big performance differences related to specific operations or language features. They don't reflect real-world performance.

Benchmark results

We have a service that automatically collects benchmark results for all mypyc and mypy commits:

Running benchmarks

Prerequisites:

  • Python 3.7 or later on Linux (or macOS?)
  • mypyc in PATH
  • A working Python C development environment

Display the names of available benchmarks using runbench.py --list:

$ python3 runbench.py --list
binary_trees
bytes_call (micro)
bytes_concat (micro)
bytes_format (micro)
bytes_indexing (micro)
...

Microbenchmarks are distinguished by (micro).

Run a benchmark using runbench.py --mypy-repo <dir> <name>:

$ python3 runbench.py --mypy-repo ~/src/mypy richards
...
running richards
......
interpreted: 0.190326s (avg of 6 iterations; stdev 1%)
compiled:    0.019284s (avg of 6 iterations; stdev 1.6%)

compiled is 9.870x faster

This runs the benchmark in both compiled and interpreted modes using the mypyc from the given mypy repository, and reports the relative performance.

Use runbench.py -c ... to only run the compiled benchmark.

Run a benchmark first using the mypy master branch and then your local branch to see how well your branch does relative to master.

Documentation

There is more information in the documentation.

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.