1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:18:12 +00:00
serenity/Userland/Libraries/LibAudio
kleines Filmröllchen 14d330faba LibAudio: Avoid frequent read() calls in FLAC residual decode
Decoding the residual in FLAC subframes is by far the most I/O-heavy
operation in FLAC decoding, as the residual data makes up the majority
of subframe data in LPC subframes. As the residual consists of many
Rice-encoded numbers with different bit sizes for differently large
numbers, the residual decoder frequently reads only one or two bytes at
a time. As we use a normal FileInputStream, that directly translates to
many calls to the read() syscall. We can see that the I/O overhead while
FLAC decoding is quite large, and much time is spent in the read()
syscall's kernel code.

This is optimized by using a Buffered<FileInputStream> instead, leading
to 4K blocks being read at once and a large reduction in I/O overhead.

Benchmarking with the new abench utility gives a 15-20% speedup on
identical files, usually pushing FLAC decoding to 10-15x realtime speed
on common sample rates.
2021-11-28 13:33:51 -08:00
..
Buffer.cpp LibAudio: Verify source and target rates for ResampleHelper 2021-11-21 09:27:00 +01:00
Buffer.h LibAudio: Rename Audio::Frame -> Audio::Sample 2021-11-08 16:29:25 -08:00
ClientConnection.cpp Audio: Fix code smells and issues found by static analysis 2021-11-15 23:00:11 +00:00
ClientConnection.h Libraries: Fix visibility of Object-derivative constructors 2021-11-02 22:56:53 +01:00
CMakeLists.txt LibAudio: Implement a basic FLAC loader 2021-06-25 20:48:14 +04:30
FlacLoader.cpp LibAudio: Avoid frequent read() calls in FLAC residual decode 2021-11-28 13:33:51 -08:00
FlacLoader.h LibAudio: Avoid frequent read() calls in FLAC residual decode 2021-11-28 13:33:51 -08:00
FlacTypes.h LibAudio: Implement a basic FLAC loader 2021-06-25 20:48:14 +04:30
Loader.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Loader.h Audio: Fix code smells and issues found by static analysis 2021-11-15 23:00:11 +00:00
Sample.h Audio: Fix code smells and issues found by static analysis 2021-11-15 23:00:11 +00:00
WavLoader.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
WavLoader.h Audio: Fix code smells and issues found by static analysis 2021-11-15 23:00:11 +00:00
WavWriter.cpp Audio: Fix code smells and issues found by static analysis 2021-11-15 23:00:11 +00:00
WavWriter.h Audio: Fix code smells and issues found by static analysis 2021-11-15 23:00:11 +00:00