Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slower loading because of GC issue #96

Open
PallHaraldsson opened this issue Jan 28, 2021 · 0 comments
Open

Slower loading because of GC issue #96

PallHaraldsson opened this issue Jan 28, 2021 · 0 comments

Comments

@PallHaraldsson
Copy link

PallHaraldsson commented Jan 28, 2021

I tried (saving and) loading as in issue #52

and:

julia> @time y2, fs = wavread("test.wav");
  1.144121 seconds (564.27 k allocations: 223.779 MiB, 16.12% gc time, 76.35% compilation time)

julia> @time y2, fs = wavread("test.wav");
  0.156857 seconds (60 allocations: 190.738 MiB, 18.48% gc time)

julia> @time y2, fs = wavread("test.wav");
  0.232146 seconds (60 allocations: 190.738 MiB, 43.91% gc time)

julia> @time y2, fs = wavread("test.wav");
  0.143521 seconds (60 allocations: 190.738 MiB, 10.43% gc time)

a)
The first load is slower (and precompiling can presumably be improved, I know about that, see recent blog post; for now only filing an issue so not forgotten).

b)
After first run (no longer compilation overhead) still doesn't match Python:

a = time(); y, fs = read("test.wav"); time() - a
0.06549859046936035

Loading speed may not be to critical, but I assume this is not a constant factor (excepting first run overhead) and grows linearly with file size? Since it's seems to be a GC issue (at first I thought variable load on my machine) I think at least it's not an issue after loading (simply a memory buffer, and using/playing/accessing it shouldn't trigger GC?).

Do you hink it might be a simple issue to fix and/or memory mapping file could help? At least it's no longer "40 times slower" :) I'm on v"1.7.0-DEV.386", it was slightly faster than Julia 1.5.

julia> @time using WAV
  0.431934 seconds (433.26 k allocations: 28.546 MiB, 2.52% gc time, 1.76% compilation time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant