GithubHelp home page GithubHelp logo

adinapoli / o-ring Goto Github PK

View Code? Open in Web Editor NEW

This project forked from meox/o-ring

0.0 1.0 0.0 29 KB

Ring Erlang exercize implemented in several languages

Go 8.30% Elixir 19.83% Makefile 3.41% Shell 0.80% Erlang 16.05% Haskell 37.96% Pony 13.65%

o-ring's Introduction

O-Ring

Ring Erlang exercise implemented in several languages.

Exercise

Taken from "Programming Erlang", second edition (by Joe Armstrong):

Write a ring benchmark. Create N processes in a ring. Send a message
round the ring M times so that a total of N * M messages get sent. Time
how long this takes for different values of N and M.
Write a similar program in some other programming language you are
familiar with. Compare the results. Write a blog, and publish the results
on the Internet!

Guidelines

To partecipate to the benchmark, you must adopt on the following guidelines:

  • every implementation shall expose an executable file (bash script or program) named ring
  • every implementation shall agree on the following API when ring is invoked: ./ring NumberOfNodes NumberOfTrips where:
    • NumberOfNodes: the number of processes/threads/nodes in the ring, N in the description above
    • NumberOfTrips: the number of times a message is passed in the ring, M in the description above
    • returned value of the script should be 0 if ok
    • in case of errors, nothing shall be written on stdout (you can write on stderr), and error code shall be different than 0
  • every implementation shall measure the time interval T0 used to setup the ring
  • every implementation shall measure the time interval T1 in milliseconds between the instant the first message is sent and the instant the last one is received
  • every implementation shall write to stdout a single number, T, described above
  • every implementation shall be provided in a separated folder with a significant name
  • every implementation shall provide a README.md file with (at least) the following sections:
    • Build: instructions on how to build; after a successful build, a ring executable should be present in a build directory
    • Description: a brief description of the implementation
  • every implementation has complete freedom on all other aspects not specified above

Example Output

> ./ring 200000 30
465 2990 200000 30

where:

  • 465 is the time in ms to setup the ring
  • 2990 is the time in ms from the first message to the last one
  • 200000 is the number of nodes in the ring
  • 30 is the number of trips (how many times we sent a message in the ring)

Erlang

  • Build
cd erling
erlc ring.erl
  • Run
./ring 200000 30

Elixir

  • Build
cd exring
mix escript.build
  • Run
./exring 200000 30

Go

  • Build
cd goring
make all
  • Run
./ring 200000 30

Haskell

  • Build
cd haskring
make all
  • Run
./ring 200000 30

Scala

Benchmark

Authors

  • Federico Bertolucci
  • Gian Lorenzo Meocci (glmeocci @ gmail.com)
  • Nicola Bonelli (nicola.bonelli @ gmail.com)

o-ring's People

Contributors

awgn avatar meox 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.