sigstart / zerocheck

A small benchmark problem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check files for zero contents

This mini-benchmark was born when I had to check my drive for files which contained only zero bytes due to a OneDrive malfunction.

If you'd like to play along, write a program in your favourite language that does the following:

  • Accept a commandline argument filename
  • Terminate with no output if the file contains anything other than a zero byte
  • Print filename to stdout if the file contains only zero bytes

You may assume that the file is small enough to fit in memory.

Docker

If you don't want to install all of compilers used in this benchmark, the included Dockerfile containerizes them for you.

Build the image in the normal way. This will take awhile, you are downloading a tonne of compilers:

docker build -t zerocheck .

After building the image, you can create a container:

docker run --rm -v ${PWD}:/home/jovyan/zerocheck -p 8888:8888 --name zerocheck zerocheck

Copy the URL echoed to your terminal into your browser of choice to open the Jupyter Notebook.

Open a new terminal window to run a shell on the container, so you can build and run the benchmarks:

docker exec -it zerocheck /bin/bash
cd zerocheck
make builds
make FILENAME=./tmp/zero bench

You can now open the Jupyter notebook and plot the results:

http://127.0.0.1:8888/notebooks/work/Analyse%20results.ipynb

About

A small benchmark problem


Languages

Language:Jupyter Notebook 72.3%Language:Makefile 8.6%Language:Python 5.1%Language:Dockerfile 4.3%Language:C++ 3.4%Language:Rust 1.4%Language:C# 1.4%Language:Swift 1.3%Language:Go 1.2%Language:Haskell 1.1%