Code Monkey home page Code Monkey logo

Comments (5)

konstantin-sancom avatar konstantin-sancom commented on August 22, 2024

Update.
The problem is here:

              //The fft struct is reused
              PFFFT_Setup *fftSetup = processor->runner->fftSetup;
              float *fft_in= processor->runner->fft_in;
              float *fft_out= processor->runner->fft_out;

In multithreading it is not possible to "reuse" those objects.

from olaf.

JorenSix avatar JorenSix commented on August 22, 2024

Hi,

I am not sure about the added value of multi-threading. Perhaps your tests might prove otherwise but I think decoding and storage are the bottleneck. From the readme:

Olaf is single threaded. The main reasons are simplicity and limitations of embedded platforms. The single threaded design keeps the code simple. On embedded platforms with single core CPU’s multithreading makes no sense. On traditional computers there might be a performance gain by implementing multi-threading. However, the time spent on decoding audio and storing fingerprints is much larger than analysis/extraction so the gain might be limited. As an work-around multiple processes can be used simultaniously to query the database.

from olaf.

JorenSix avatar JorenSix commented on August 22, 2024

But please do not let that stop you to experiment and look where data is shared which should better not be shared. Or how to improve Olaf in general. I am grateful for all constructive criticism on the code! Thanks!

from olaf.

konstantin-sancom avatar konstantin-sancom commented on August 22, 2024

But please do not let that stop you to experiment and look where data is shared which should better not be shared. Or how to improve Olaf in general. I am grateful for all constructive criticism on the code! Thanks!

Ok. I see now - this code is for embeded systems.
On x86 platforms there is a a reason for multithreading and I made it work, BTW.
DB for reading is not a "bottleneck" - it is threadsafe (from the lmdb documentation), they say: there may be a lot of readers as processes or threads without locking eacj other, even there can one writer, not blocking readers.

from olaf.

JorenSix avatar JorenSix commented on August 22, 2024

Congrats! Very curious to see which changes were needed and how that would look and which effects it would have on (query) performance. Especially vs queries from multiple processes.

from olaf.

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.