MTG / essentia.js

JavaScript library for music/audio analysis and processing powered by Essentia WebAssembly
https://essentia.upf.edu/essentiajs
GNU Affero General Public License v3.0
628 stars 41 forks source link

Test benefits of OO interface #65

Open jmarcosfer opened 2 years ago

jmarcosfer commented 2 years ago

(Related to #64)

Description

Before committing to an Object-Oriented interface of class + compute method, try out the approach outlined on #64 for only one or two algorithms (e.g. melspectrogram), and compare to the current (functional) interface.

How?

One of the aims stated in #64, besides matching the upstream Essentia interface, is to make the library more performant.

Thus, comparison should be made between the two interface styles in terms of execution speed and/or memory.

For execution speed, something like benchmark.js could be used. For memory usage, perhaps try Chrome's performance.measureUserAgentSpecificMemory() or the memory profiling options on devtools.

jmarcosfer commented 5 months ago

@albincorreya I have now done this here. It's on its own branch, but it is code that I don't think will ever be merged into dev or master.

That's why I'm not opening a PR and doing the review here.

albincorreya commented 5 months ago

@jmarcosfer Nice. From your results, performance boost for MFCC computation is significant as expected. Maybe we could also try memory profiling on browsers just to get an idea of it?

jmarcosfer commented 5 months ago

Yep, definitely! I'm already working on the class-based implementation for the whole library, to make progress on that in parallel. But I would like to do memory profiling on Chrome very soon.