Coder Social home page Coder Social logo

glathoud / flatorize Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 1.0 10.57 MB

Generate fast implementations of mathematical expressions. Inclues a linear algebra library.

Home Page: http://glat.info/flatorize

License: Apache License 2.0

Shell 0.37% JavaScript 50.87% Python 8.83% CSS 0.16% C 18.12% HTML 12.27% D 9.37%
mathematical-expressions javascript performance code-generation dlang clang javascript-asm-js linear-algebra

flatorize's People

Contributors

glathoud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

i-e-b

flatorize's Issues

flatorize_d?

See if we can derive D code generation without too much pain, most likely by cloning flatorize_c.

asm.js plugin

background: we already have support for basic types in the C plugin. We could reuse this to generate asm.js code, and compare the performance:

  • with the original JS code.
  • with the corresponding C code.

update C plugin

...with the recent asm.js plugin code, and since code generation now runs fast, make a single python script to run it all.

2014-12-01 note about GCC:

  • one or two years ago I could compile the stuff under explore/C with -O3 without any problem.
  • in an old VM with an old GCC I had a strange pointer "unwanted decrement bug" when returning the struct from the malloc helper. Workaround: write the struct with the array float io_array[] first, then declare the convenience pointers float *. The bug disappeared.
  • on my Ubuntu laptop with GCC 4.8.2, the newly generated DFT1024 "big code" cannot compile anymore with any of -O1, -O2 or -O3. Neither compile the above-mentioned old stuff under explore/C with -O1, -O2 or -O3 - code that hasn't changed!
  • without those options the C code is running 2x slower than Chrome 39.
  • slowly getting fed up with GCC.
  • since the general spirit of flatorize is to get a "fast enough" performance in a generic and portable manner, i.e. reliably, i.e. also a "fast enough" software development experience, and not to get the absolute fastest performance at all costs, I am considering alternatives like clang.

Now with clang: Speed comparison JavaScript vs. C:

On an Ubuntu laptop for the (heavy) DFT1024 case I measured a speed of about 47800 iterations per seconds for Chrome 39 and about 60000 iterations per seconds for clang.

This is fast enough for me to do scientific computation in the browser with a much much faster and simpler developement process (JavaScript) than in C.

compare flatorize_c with FFTW

Just for fun compare on the DFT1024 test case:

  • the generic flatorize_c code generation + clang compilation, as well as with GCC (see issue #2 with GCC, but does not always happen)
  • the specific FFTW + gcc compilation

misc:

flatorize_ocaml?

See if we can derive OCaml code generation without too much pain, most likely by cloning flatorize_c.

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.