Tracktion/tracktion_engine

Optimise Elastique Direct

Closed this issue · 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:

  • Process 0 numSamples
  • Check why reset is called twice
  • 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

Image

Before changes

Using memory mapped reader for compressed formats:
Image

After initial spreading:

Image

kNoOpt:
image

kNormal:
image

kFast:
image