Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #112 #113

Merged
merged 2 commits into from
May 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,26 @@ Execute:
```
examples/cpp/mp_mandelbrot.sh
```
Then you should see a new file under `examples/output`.
Then you should see a new file under `examples/output`.

### Benchmark: Creating a simple mandelbrot using a custom formula with MPFR
In this example we use [google microbenchmark support library] to get some feedback about calculations performance with [mpfr library](https://www.mpfr.org/).
Execute:
```
examples/cpp/mp_benchmark.sh
```
Check the output, it should be something like:
```shell
Run on (4 X 2300 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x4)
L1 Instruction 32 KiB (x4)
L2 Unified 256 KiB (x4)
L3 Unified 6144 KiB (x4)
Load Average: 1.02, 0.55, 0.38
***WARNING*** Library was built as DEBUG. Timings may be affected.
----------------------------------------------------------------------
Benchmark Time CPU Iterations
----------------------------------------------------------------------
BM_fractal/min_time:120.000 5414 ms 5396 ms 31
```
2 changes: 1 addition & 1 deletion examples/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ target_link_libraries(example ${CMAKE_DL_LIBS})

add_definitions(-DTHREADS -D_REENTRANT -DPNG_ENABLED -DJPG_ENABLED)

add_subdirectory(benchmark)
find_package(benchmark REQUIRED)
target_link_libraries(example benchmark::benchmark)

# FRACT_STDLIB
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN git clone https://github.com/google/benchmark.git && \
git clone https://github.com/google/googletest.git benchmark/googletest && \
cd benchmark && \
mkdir build && cd build && \
cmake ../ && make
cmake ../ && make && make install


ARG main_source
Expand Down