Giter Site home page Giter Site logo

darklang / fizzboom Goto Github PK

View Code? Open in Web Editor NEW
48.0 3.0 7.0 482 KB

Benchmark to compare async web server + interpreter + web client implementations across various languages

Home Page: https://blog.darklang.com/fizzboom-benchmark/

License: MIT License

Shell 1.96% F# 70.90% Python 1.56% Rust 13.97% OCaml 7.45% C# 4.17%
benchmark fizzbuzz interpreter rust ocaml webserver fsharp

fizzboom's Introduction

Benchmark the same async program across Rust, OCaml, and F#.

These days, it's mostly used to benchmark F# in various different configurations.

Benchmark overview

This is a benchmark to test what's the best language for implementing Dark in. Dark already has an implementation, but we are looking for improvements, especially around async.

The benchmark is fizzbuzz: using an interpreter connected to web server, dynamically calculate fizzbuzz and return it as a JSON response. This is to test the raw speed of the HTTP server and interpreter.

The most important metric is requests/second.

Contributing

No-one likes to see their favorite language lose at benchmarks, so please feel free to submit pull requests to improve existing benchmarks, or add new variations (different web servers, new languages/frameworks, etc). Some rules:

  • the interpreter must be easy to update, add to, and improve. As such, no microoptimizations, assembly code, JITs, etc. However, it is fine to:
    • add one-off fixes that for example, improve the compiler optimization settings, the webserver configuration, etc. Whatever you'd use for best performance in production is fine.
    • if the code had bad performance that's unfairly penalizing your language (eg due to a compiler bug), it's fine to propose alternatives
    • fix existing bad code (eg if data is being copied unnecessarily)
    • provide code review for existing implementations
  • I can't imagine all the ways that people will try to game this, so I'm definitely going to reject things that don't support how we'd actually want to write Dark's backend. New rules will come as this happens.

Overview of codebase

The benchmark is implemented in measure.py. Requires wrk to be installed.

Run ./measure to test all the fizzbuzz implementations, or ./measure <directory_name1> <directory_name2> <etc> to test a subset of them.

Benchmarks

Each benchmark candidate is in its own directory, which has some known files:

  • ./install.sh - installs dependencies
  • ./build.sh - builds the server. This should use release configuration
  • ./run.sh - runs the server on port 5000
  • BROKEN - if this file exists, skip the implementation in this directory

Benchmarks implement a HTTP server connected to an interpreter which each implement a simple subset of the dark language.

The purpose of the benchmark is to establish:

  • how fast the language is
  • what is the cost of async
  • test variations of using async to see how performance can be improved

The sync implementation helps us figure out a baseline for the performance. We can then compare the sync and async implementation on fizzbuzz to see how much async costs.

Different languages can be compared async-vs-async for (which is raw performance given fizzbuzz constraints).

The optimized async implementation is to see the value of different optimizations and see if there are ways to optimize above a baseline async implementation.

Results

Recent results are posted to the Result issue

Code of Conduct

Dark's community is held to the Dark Code of Conduct. Benchmarks can be contentious, please be kind to all people involved.

License

MIT

fizzboom's People

Contributors

dependabot[bot] avatar mlaily avatar naim94a avatar pbiggar avatar rfvgyhn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fizzboom's Issues

Make OCaml multi-core with nginx

FSharp and Rust get to use all the cores on the machine - OCaml does not. In practice, we'd run a bunch of OCaml processes and put a load balancer in front of them. This is a fairer test.

Add graphing

Store the data in a file during the benchmarks and make graphs out of them

Results

This thread will store the latest results.

Make the size of fizzbuzz/fizzboom configurable

Change the request to /fizzbuzz/:<count:int>, then use that as the parameter to fizzbuzzes.

Happy to do this in parts: make the requests use /fizzbuzz/100 first and then change the implementations piecemeal

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.