Giter VIP home page Giter VIP logo

Comments (3)

jonwright avatar jonwright commented on June 17, 2024

Hi Younes - I would not like to learn cython but speedups are generally welcome. You can usually get a much bigger speedup by using a different algorithm. Grid index is an especially bad example of using a poor algorithm which is sensitive to parameter selection. There is a testcase simul_1000_grains which can be used for profiling. The methods from Sharma's PhD work should go a lot faster anyway (match up Friedel pairs and look at position constraints as part of indexing).

There are some issues about load balancing between openmp versus multiprocessing depending on the problem size and machine you are running on. It is very bad to have lots of processes that all start lots of threads.

If you think some routine is "slow" you can try adding @numba.jit before a function call and see if it makes any difference.

from imaged11.

younes-elhachi avatar younes-elhachi commented on June 17, 2024

Thank you Jon for these interesting insights. Indeed, xrd indexing algorithms are not time consuming, compared to 3D tomography, finite elements and other heavy scientific computing tasks.
I saw a little talk where cython improved speed by x100 simply by declaring c-like variables and writing python code, but I'm not sure how steep is its learning curve though (when it comes to advanced optimization).
I will take a closer look to Sharma's work and I would like to do some profiling with numba, cython, openmp/multiprocessing if I find a free cloud cpu service (my local machine has 8 threads, a rather ordinary processor).
I like the ImageD11 algorithm, and all the useful function the software offers. If I may ask, are you planning to refactor it using a new algorithm in the future or you would prefer to focus on adding additional features / continuous improvements to the current software?
Thanks a lot!

from imaged11.

jonwright avatar jonwright commented on June 17, 2024

So I will close this for now - numba has been creeping into the code lately.

from imaged11.

Related Issues (20)

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.