Skip to content

Understand the performance differences between several languages, and illustrate semantic differences between the languages.

Notifications You must be signed in to change notification settings

mpickering/LanguageComparison

 
 

Repository files navigation

Language Performance Comparison

Purpose

Understand the performance differences between several languages, and illustrate symantic differences between the languages.

Languages being compared:

  1. C#
  2. Rust
  3. PureScript
  4. Haskell
  5. Elixir

Performance Comparison

  • 1.2M Accounts
  • 10M Transactions
Machine C# Rust PureScript Haskell Elixir
Alfredo 42s 18s 378s 156s 185s
Dave 49s 20s 334s 184s 322s
Relative (Apprx.) 1 ½ 8 3.5 5
(Memory) 4 GB 1.6 GB x 12 GB 3 GB

Potential Next Steps

To run a dockerized version of these tests

./docker-build-test-images.sh
./docker-test-runner.sh

On linux it looks like atop might be a good tool

C#

  • Pros
    • Performance without optimization
  • Cons
    • Large holes in logic - potential failure points
  • Code
  • Running: dotnet build; time dotnet run

Rust

  • Pros
    • Correctness
    • Tool ecosystem
  • Cons
    • Borrow checker / need to understand memory layout
    • Lack of libraries
  • Code
  • Running: cargo build --release; time cargo run --release

PureScript

  • Pros
    • Correctness
  • Cons
    • Performance concerns on large datasets (not because of Node)
  • Code
  • Running: `pulp build; time node -e "require('output/Main').main()"

Haskell

  • Do Account\Transaction problem
  • Look at record syntax
  • What kind of speed to we get?
  • Code
  • Running: stack build --fast; time stack run

Elixir

  • Pros
    • Concurrent
    • Fault-tolerant
    • Clusteable
  • Cons
    • Dynamic
    • Static types (Dyalizer) are an optional add-on
  • Code
  • Running: mix deps.get; mix clean; MIX_ENV=prod mix release;mv _build/prod/rel/test_elixir . ; ./test_elixir/bin/test_elixir foreground

About

Understand the performance differences between several languages, and illustrate semantic differences between the languages.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PureScript 33.7%
  • Elixir 19.4%
  • Haskell 18.1%
  • C# 11.3%
  • Rust 10.3%
  • Shell 5.2%
  • Other 2.0%