Skip to content
Snippets Groups Projects
  • Joshua Colp's avatar
    50ac85cb
    stasis: Segment channel snapshot to reduce creation cost. · 50ac85cb
    Joshua Colp authored
    When a channel snapshot was created it used to be done
    from scratch, copying all data (many strings). This incurs
    a cost when doing so.
    
    This change segments the channel snapshot into different
    components which can be reused if unchanged from the
    previous snapshot creation, reducing the cost. In normal
    cases this results in some pointers being copied with
    reference count being bumped, some integers being set,
    and a string or two copied. The other benefit is that it
    is now possible to determine if a channel snapshot update
    is redundant and thus stop it before a message is published
    to stasis.
    
    The specific segments in the channel snapshot were split up
    based on whether they are changed together, how often they
    are changed, and their general grouping. In practice only
    1 (or 0) of the segments actually get changed in normal
    operation.
    
    Invalidation is done by setting a flag on the channel when
    the segment source is changed, forcing creation of a new
    segment when the channel snapshot is created.
    
    ASTERISK-28119
    
    Change-Id: I5d7ef3df963a88ac47bc187d73c5225c315f8423
    50ac85cb
    History
    stasis: Segment channel snapshot to reduce creation cost.
    Joshua Colp authored
    When a channel snapshot was created it used to be done
    from scratch, copying all data (many strings). This incurs
    a cost when doing so.
    
    This change segments the channel snapshot into different
    components which can be reused if unchanged from the
    previous snapshot creation, reducing the cost. In normal
    cases this results in some pointers being copied with
    reference count being bumped, some integers being set,
    and a string or two copied. The other benefit is that it
    is now possible to determine if a channel snapshot update
    is redundant and thus stop it before a message is published
    to stasis.
    
    The specific segments in the channel snapshot were split up
    based on whether they are changed together, how often they
    are changed, and their general grouping. In practice only
    1 (or 0) of the segments actually get changed in normal
    operation.
    
    Invalidation is done by setting a flag on the channel when
    the segment source is changed, forcing creation of a new
    segment when the channel snapshot is created.
    
    ASTERISK-28119
    
    Change-Id: I5d7ef3df963a88ac47bc187d73c5225c315f8423