question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

librosa becomes slower the longer it runs

See original GitHub issue

Description

My code is basically:

for fn in lots_of_flac_files:
  audio, sample_rate = librosa.load(fn, sr=None)
  mfccs = librosa.feature.mfcc(
    audio, sr=sample_rate,
    n_mfcc=40,
    hop_length=int(0.01 * sample_rate), n_fft=int(0.025 * sample_rate))

All files are about the same length. I added some simple code to estimate the remaining time. The strange thing is that this estimation did not went down, but went up only in the beginning, i.e. it became slower and slower. How could that be? Also, I noticed that the memory consumption seems to slowly increase all the time.

Expected Results

Every call to load and mfcc takes about the same time.

Actual Results

The time to execute load and mfcc always increases. (Maybe only one of them; I didn’t tested.)

Versions

>>> import platform; print(platform.platform())
Linux-4.9.0-3-amd64-x86_64-with-debian-9.3
>>> import sys; print("Python", sys.version)
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170118]
>>> import numpy; print("NumPy", numpy.__version__)
NumPy 1.14.1
>>> import scipy; print("SciPy", scipy.__version__)
SciPy 1.0.0
>>> import librosa; print("librosa", librosa.__version__)
librosa 0.6.0
>>> 

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
albertzcommented, Feb 22, 2018

Well, not totally resolved, but we can say that it is not a librosa bug, so yes, this can be closed.

1reaction
bmcfeecommented, Feb 22, 2018

Why don’t you use that by default?

Because libsndfile does not support mp3 yet. When it does, we’ll switch over.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`import librosa` slow to run at 48 seconds issue - Python 博客
Describe the bug** `import librosa` takes way too long, at 48 seconds. ... Stop the stopwatch when the Python prompt becomes responsive/available again....
Read more >
Troubleshooting — librosa 0.10.0.dev0 documentation
If you're trying to run some example code, and encounter the following error message: AttributeError: module 'librosa' has no attribute 'display'.
Read more >
Performance issues with libROSA - Google Groups
I am using libROSA from Python 2.7 to detect the BPM of a set of audio tracks. ... each run) quite happily then...
Read more >
Multiprocessing Pool slow when calling external module
To investigate what's happening, I run top -H and noticed +60 threads being spawned! That was it. Turns out librosa and dependencies spawn ......
Read more >
Why do programs get slower with time? - Johnny's Software Lab
A program that used to run at acceptable speed six months ago, ... we talk about the reasons why software becomes slower as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found