tracktion_engine icon indicating copy to clipboard operation
tracktion_engine copied to clipboard

Optimise Elastique Direct

Open drowaudio opened this issue 1 year ago • 4 comments

Starting point

256 block size, kFastStartup, ~0.8 ratio, max frames 12800

  • [ ] Check time for reset: 0.1ms
  • [ ] Check time for initial frames: 0.176ms (fr in: 2560, out: 1705)
  • [ ] Check time for first block of real frames: 0.81ms (fr in: 6144, out: 1789)
  • [ ] Check time for subsequent blocks of real frames: ~0.25ms (fr in: 512, out: 427)

Using memory mapped reader for compressed formats

256 block size, kFastStartup, ~0.8 ratio, max frames 12800

  • [ ] Check time for reset: 0.07ms
  • [ ] Check time for initial frames: 0.17ms (fr in: 2560, out: 1705)
  • [ ] Check time for first block of real frames: 0.8ms (fr in: 6144, out: 1789)
  • [ ] Check time for subsequent blocks of real frames: ~0.25ms (fr in: 512, out: 427)

Spread process calls

256 block size, kFastStartup, ~0.8 ratio, max frames 12800

  • [ ] Check time for reset: 0.06ms
  • [ ] Check time for initial frames: 0.15ms (fr in: 2560, out: 1705)
  • [ ] Check time for first block of real frames: 0.3ms (fr in: 6144, out: 1789)
  • [ ] Check time for subsequent blocks of real frames: ~0.5ms (fr in: 512, out: 427)

Efficient

256 block size, kFastStartup, ~0.8 ratio, max frames 12800

  • [ ] Check time for reset: 0.1ms
  • [ ] Check time for initial frames: 0.03ms (fr in: 2560, out: 1705)
  • [ ] Check time for first block of real frames: 0.25ms (fr in: 6144, out: 1789)
  • [ ] Check time for subsequent blocks of real frames: ~0.25ms (fr in: 512, out: 427)

Efficient

256 block size, kNormalStartup, ~0.8 ratio, max frames 12800

  • [ ] Check time for reset: 0.1ms
  • [ ] Check time for initial frames: 0.05ms (fr in: 2560, out: 1705)
  • [ ] Check time for first block of real frames: 0.28ms (fr in: 6144, out: 1789)
  • [ ] Check time for subsequent blocks of real frames: ~0.3ms (fr in: 512, out: 427)

Mobile

256 block size, kFastStartup, ~0.8 ratio, max frames 12800

  • [ ] Check time for reset: 0.2ms
  • [ ] Check time for initial frames: 0.04ms (fr in: 2560, out: 1705)
  • [ ] Check time for first block of real frames: 0.12ms (fr in: 6144, out: 1789)
  • [ ] Check time for subsequent blocks of real frames: ~0.1ms (fr in: 512, out: 427)

Spread more:

Pro

256 block size, kFastStartup, ~0.8 ratio, max frames 12800

  • [ ] Check time for reset: 0.25ms
  • [ ] Check time for initial frames: 0.2ms (fr in: 2560, out: 1705)
  • [ ] Check time for first block of real frames: 0.45ms (fr in: 6144, out: 1789)
  • [ ] Check time for subsequent blocks of real frames: ~0.4ms (fr in: 512, out: 427)

Efficient

256 block size, kFastStartup, ~0.8 ratio, max frames 12800

  • [ ] Check time for reset: 0.16ms
  • [ ] Check time for initial frames: 0.05ms (fr in: 2560, out: 1705)
  • [ ] Check time for first block of real frames: 0.2ms (fr in: 6144, out: 1789)
  • [ ] Check time for subsequent blocks of real frames: ~0.22ms (fr in: 512, out: 427)

Efficient

256 block size, kNormalStartup, ~0.8 ratio, max frames 12800

  • [ ] Check time for reset: 0.2ms
  • [ ] Check time for initial frames: 0.1ms (fr in: 2560, out: 1705)
  • [ ] Check time for first block of real frames: 0.17ms (fr in: 6144, out: 1789)
  • [ ] Check time for subsequent blocks of real frames: ~0.18ms (fr in: 512, out: 427)

Todo:

  • [x] Process 0 numSamples
  • [x] Check why reset is called twice
  • [x] Compressed files miss first block - use mapped reader
  • [ ] Space out process calls
    • For first block getFramesNeeded(), return the number of pre-frames and the fist real block of frames
    • For the first process block do the usual pre-processing and fill out output fifo but then also do the first block of real frames but return immediately
    • For a few blocks, if numSamples is 0, do a number of ProcessData() calls and return
  • [ ] Spread process calls more
  • [ ] Default to efficient

drowaudio avatar Jan 29 '24 11:01 drowaudio

Image

Before changes

drowaudio avatar Jan 29 '24 14:01 drowaudio

Using memory mapped reader for compressed formats: Image

drowaudio avatar Jan 29 '24 16:01 drowaudio

After initial spreading:

Image

drowaudio avatar Jan 29 '24 22:01 drowaudio

kNoOpt: image

kNormal: image

kFast: image

drowaudio avatar Jan 30 '24 13:01 drowaudio