Skip to content
Snippets Groups Projects
  • Corey Farrell's avatar
    289549d6
    media_index: Improve startup. · 289549d6
    Corey Farrell authored
    This eliminates some wasteful operations in media_index startup.
    
    * Replace statically set string-fields with char[0].
    * Eliminate pointless RAII_VAR's.
    * alloc_variant: Avoid pointless ao2_find on new info->variant.
    * Stop trying find_variant before alloc_variant.
    * process_media_file: replace ast_str with ast_asprintf.  This avoids
      reallocation of file_id_str.
    
    Overall sounds_index.c is about 27% of Asterisk startup time when using
    sample configs.  This patch reduces it to 20%.  This is a half-fix.  The
    real problem is that the media_index is regenerated repeatedly - 68
    times in my test.
    
    Change-Id: Ia50b752f8efb356f852b05c4be495a6631af8652
    289549d6
    History
    media_index: Improve startup.
    Corey Farrell authored
    This eliminates some wasteful operations in media_index startup.
    
    * Replace statically set string-fields with char[0].
    * Eliminate pointless RAII_VAR's.
    * alloc_variant: Avoid pointless ao2_find on new info->variant.
    * Stop trying find_variant before alloc_variant.
    * process_media_file: replace ast_str with ast_asprintf.  This avoids
      reallocation of file_id_str.
    
    Overall sounds_index.c is about 27% of Asterisk startup time when using
    sample configs.  This patch reduces it to 20%.  This is a half-fix.  The
    real problem is that the media_index is regenerated repeatedly - 68
    times in my test.
    
    Change-Id: Ia50b752f8efb356f852b05c4be495a6631af8652