Skip to content

Time-based samplers are significantly slower than index-based samplers #256

@NicolasHug

Description

@NicolasHug

Running our sampler benchmark:

----------
num_clips = 1
clips_at_random_indices     med = 40.67ms +- 25.31
clips_at_regular_indices    med = 25.99ms +- 16.88
clips_at_random_timestamps  med = 39.64ms +- 22.33
clips_at_regular_timestamps med = 34.39ms +- 5.21
----------
num_clips = 50
clips_at_random_indices     med = 307.58ms +- 493.30
clips_at_regular_indices    med = 382.15ms +- 202.65
clips_at_random_timestamps  med = 4425.34ms +- 1046.69
clips_at_regular_timestamps med = 3096.98ms +- 910.78

This is likely due to the fact that our frame deduplication logic isn't really effective when we dedup timestamps. It's likely that we are decoding the same frame multiple time, and we didn't de-dup that frame because it was requested at slightly different ptss.

We should convert the pts to indices first for the dedup logic to be more efficient. This is something we can do once we implement all this in C++.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions