Git Product home page Git Product logo

burstfft's People

Contributors

keijiro avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

burstfft's Issues

Parallel is faster than serial for larger fft size

Thanks for the excellent code keijiro! FWIW, as I was testing your code inside my application I noticed that as fft size continues to be increased the parallel version does eventually become faster than the serial version. For me this was around 16,384 samples (with leak detection off, burst safety checks off, and jobs debugger disabled). I am sharing this in case you want to update your README.

Parallel benchmarks...

BurstFft (length=1024) Millisecond Median:0.10 Min:0.10 Max:0.11 Avg:0.10 Std:0.01 SampleCount: 9 Sum: 0.90
BurstFft (length=8192) Millisecond Median:0.23 Min:0.22 Max:0.24 Avg:0.23 Std:0.00 SampleCount: 9 Sum: 2.04
BurstFft (length=16384) Millisecond Median:0.29 Min:0.28 Max:0.31 Avg:0.29 Std:0.01 SampleCount: 9 Sum: 2.64
BurstFft (length=65536) Millisecond Median:0.53 Min:0.53 Max:0.55 Avg:0.54 Std:0.01 SampleCount: 9 Sum: 4.82

Serial benchmarks...

BurstFft (length=1024) Millisecond Median:0.03 Min:0.03 Max:0.03 Avg:0.03 Std:0.00 SampleCount: 9 Sum: 0.23
BurstFft (length=8192) Millisecond Median:0.14 Min:0.14 Max:0.14 Avg:0.14 Std:0.00 SampleCount: 9 Sum: 1.22
BurstFft (length=16384) Millisecond Median:0.28 Min:0.28 Max:0.28 Avg:0.28 Std:0.00 SampleCount: 9 Sum: 2.49
BurstFft (length=65536) Millisecond Median:1.17 Min:1.17 Max:1.17 Avg:1.17 Std:0.00 SampleCount: 9 Sum: 10.52

Test code...

    [Test, Performance]
    public void BurstFft()
    {
        int[] LENGTHS = new int[] { 1024, 8192, 16384, 65536 };
        for (var i = 0; i < LENGTHS.Length; ++i) {
            var x = new float[LENGTHS[i]];
            var spectrum = new float[LENGTHS[i]];
            var fft = new BurstFft(x.Length);
            var input = new NativeArray<float>(x.Length, Allocator.Persistent);
            Measure.Method(() =>
            {
                AudioListener.GetOutputData(x, 0);
                input.CopyFrom(x);
                fft.Transform(input);
                fft.Spectrum.CopyTo(spectrum);
            }).SampleGroup($"BurstFft (length={LENGTHS[i]})").Run();
            input.Dispose();
            fft.Dispose();
        }
    }

License

Hello,

I would like to use this project in the creation of a school project and was wondering if you could add a license to this project or if I could get permission to use this code in my project ?

Thanks.

Note: "Parallel Burst FFT" might not be running in parallel

I've had a look at the code trying to use it.

Then I noticed that the jobs should not be able to run in parallel. The following code (simplified):

var handle = new FirstPassJob(...)
for(...)
    handle = new DftPassJob { ... }.Schedule(..., handle);

As you can see, a bunch of jobs are created, which I assume should be run in parallel. However, each of the parallel jobs depends on the job handle of the previous loop iteration, which means all the jobs will be executed in sequence, and not in parallel. Is it correct?

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.