Skip to content

Rusty mandelbrot - single and multi-threaded - output as PNG

Notifications You must be signed in to change notification settings

jesper-olsen/mandelbrot-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mandelbrot-rs

Rusty Mandelbrot - can run sequentially or spawn multiple processes.

Other languages:

Run

% cargo run --release -h
Usage: mandelbrot-rs [OPTIONS]

Options:
  -d, --dim <D>     pixel dimensions (width,height) [default: 1000,750]
  -x, --xrange <X>  xrange: min,max [default: -1.20,-1.0]
  -y, --yrange <Y>  yrange: min,max [default: 0.20,0.35]
  -h, --help        Print help
  -V, --version     Print version
% cargo run --release
Saving output to mandelbrot.png

PNG

Benchmark

Below we will benchmark the time it takes to calculate a 25M pixel mandelbrot on a Macbook Air M1 (2020, 8 cores). All times are in seconds, and by the defaults it is the area with lower left {-1.20,0.20} and upper right {-1.0,0.35} that is mapped.

The image is calculated row by row - in multi-threaded mode Rayon farms the rows out to different threads.

% time cargo run --release -- --dim 5000,5000 

Sequential

Time (real) Time (user) Speedup
7.7 7.3

Multi-threaded

Time (real) Time (user) Speedup
1.7 9.6 4.5

About

Rusty mandelbrot - single and multi-threaded - output as PNG

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages