Skip to content

Instantly share code, notes, and snippets.

@lukechilds
Created February 27, 2020 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukechilds/f5c4a0a255fe65a6c788f047f413223b to your computer and use it in GitHub Desktop.
Save lukechilds/f5c4a0a255fe65a6c788f047f413223b to your computer and use it in GitHub Desktop.
Simple multithreaded shell benchmark

Simple multithreaded shell benchmark

# 1 thread
$ time bench()

real    0m46.143s
user    0m45.798s
sys     0m0.188s

# 4 threads in parralel
$ time (for i in {1..4}; do bench() & done; wait)

real    0m59.837s
user    3m50.724s
sys     0m1.351s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment