Closed jg-854 closed 2 years ago
This looks great! Thanks!
Merging #100 (f349a7a) into master (3cd4551) will increase coverage by
6.26%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #100 +/- ##
==========================================
+ Coverage 91.39% 97.66% +6.26%
==========================================
Files 2 2
Lines 337 342 +5
==========================================
+ Hits 308 334 +26
+ Misses 29 8 -21
Impacted Files | Coverage Δ | |
---|---|---|
src/PortAudio.jl | 97.76% <ø> (+5.51%) |
:arrow_up: |
src/libportaudio.jl | 97.29% <0.00%> (+9.41%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 3cd4551...f349a7a. Read the comment docs.
The Julia documentation states that fields with abstract types can lead to performance problems.
Buffer
contains the fielddata::Array{Sample} where Sample
. This type has a free parameter, namely the dimension of the array, and therefore , it will lead to type-instability when calling the functiongetproperty(buffer, :data)
.I believe, from experiments on my local machine, the type-instability is leading to unnecessary allocations when calling
PortAudio.read_or_write
(which ideally should have 0 allocations for real-time applications?). When running the following code:By updating the field type such that it is now of type
Array{Sample, 2}
, retrieving the raw data is now type-stable and allocations are removed.