Giter Site home page Giter Site logo

sintharic / performance-tests Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 19 KB

Collection of small scientific projects comparing different programming languages and impelementations with respect to performance and ease of use.

Makefile 15.40% C++ 53.81% C 0.99% Julia 10.66% Python 19.15%

performance-tests's Introduction

Collection of small scientific projects comparing different programming languages and impelementations with respect to performance and ease of use.

FFT results

Benchmark consists of two 2D double precision arrays (resolution N x N) and their Fourier transforms. A triangular wave in x- and y-direction is generated one wave vector after the other and transformed back and forth each time.

Computation time on MacBook Pro 2019 at N=1024:

  • Julia (using Intel MKL): 7.6 s
  • Julia (using FFTW): 9.0 s
  • C++: 12.6 s
  • Python: 15.5 s

Memory usage (according to top) on MacBook Pro 2019 at N=1024:

  • C++: 50 MB
  • Python: ~95 MB (32 MiB according to tracealloc)
  • Julia (using FFTW): ~160 MB (352 MiB according to maxrss???)
  • Julia (using Intel MKL): ~170 MB (352 MiB according to maxrss???)

Benchmarks involving different resolutions or other computational tasks may follow in the future.

Caveats

Figuring out memory usage appears to be a difficult task, since it does not necessarily take all the linked libraries into account. While Julia and Python both provide their own internal measurement tools, C++ does not and valgrind does not seem to work on Mac. With zero overhead, given that a double is 8 byte and a complex<double> is 16 byte, I would calculate an ideal memory usage of 2*8*1024*1024 + 2*16*1024*513 = 33.6 MiB, i.e. just above 2^25 bytes. Python's internal estimate was somehow below that value. And the estimate reported by my tracker function in Julia was an entire order of magnitude above...

Summary

  • Julia's speed is very impressive.
  • Julia's 1-based indexing is very inconvenient.
  • The amount of C++ boilerplate necessary to perform such easy tasks makes me very sad.
  • I need to figure out better ways to measure memory consumption before I continue with these benchmarks.

performance-tests's People

Contributors

sintharic avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.