Comments (2)
Benchmark results
Parameters
- Commit: f3a8747
- CPU: Intel Core i7-6700HQ CPU @ 2.60GHz
- OS: Ubuntu 20.04.1 LTS
- Metric: Max. number of concurrent waveforms without audio buffer underrun (
--out-buf 2048
)
Organ 1
f64
: 200 (= 800Sin
stages)f32
: 300 (= 1200Sin
stages)
Plucked String
f64
: 510f32
: 480
Fat Sawtooth 1
f64
: 800 (= 1600Sawtooth
stages)f32
: 790 (= 1580Sawtooth
stagess)
Triangle Harp
f64
: 900f32
: 880
Conclusion
- When using regular arithmetic on a 64-bit CPU
f64
offers a slightly better performance thanf32
. This result is not completely unexpected since 64-bit CPUs are designed to consumef64
s in a single instruction. The fact that anf64
consumes twice as much memory as anf32
does not seem to play a significant role. - However, for more complex arithmetic involving convergence like
{float}::sin
,f32
clearly is faster thanf64
. The obvious explanation is that sincef64
has a higher precision thanf32
more iteration steps are required until a value is fully converged.
Follow-Up
- For the sake of consistency and since a numeric precision loss is undesired, use
f64
everywhere. - The cost for transforming an
f64
buffer from and to anf32
audio buffer is expected to be negligible. - Check if there are other ways of improving
f64::sin
without sacrificing numeric precision.
from tune.
Consistent usage of f64
implemented in 206b416
New benchmark results:
- Organ 1: 200
- Plucked String: 680
- Fat Sawtooth 1: 810
- Triangle Harp: 860
from tune.
Related Issues (20)
- Apply live retuning in microwave HOT 3
- Add rotary effect control over MIDI HOT 1
- Audio-in HOT 1
- Add modular effects chain HOT 1
- Add live interactions with waveforms HOT 1
- Add ANSI Keyboard support HOT 4
- Pre-render sin function to array
- tune scale documentation HOT 9
- Library vision (tracking issue)
- Named waveform buffers
- Split LfSource into a spec and state object HOT 1
- Add benchmarks HOT 1
- Remove DC offset / Implement DC filter
- Microwave requires Vulkan-compatible graphics HOT 7
- StreamConfigNotSupported error on Windows HOT 2
- MIDI in leaves GUI artefacts HOT 8
- Error on build HOT 2
- Add adaptive tuning
- ItemOutOfRange error generated on import. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tune.