nschlia / ffmpegfs

FUSE-based transcoding filesystem with video support from many formats to FLAC, MP4, TS, WebM, OGG, MP3, HLS, and others.
https://nschlia.github.io/ffmpegfs/
GNU General Public License v3.0
206 stars 14 forks source link

Enhance memory allocation strategy #141

Closed nschlia closed 1 year ago

nschlia commented 1 year ago

The current implementation of FFmpegfs allocates one page of memory (typically 4096 bytes), then it reserves the entire anticipated amount of memory right away. If there isn't enough room, it reallocates little bits until the file is the right size.

It could be more effective; FFmpegfs could allocate the entire intended size at once and avoid the inevitable iteration. And if additional memory is needed, larger chunks should be allocated.

Idea:

That should enable another n or so commits before a new block needs to be allocated.