Skip to content
Snippets Groups Projects
  • Matthew Jordan's avatar
    16fd65bb
    Improve disk writes for wav49 format · 16fd65bb
    Matthew Jordan authored
    Writing to a file in the wav49 format performs rather inefficiently. The
    procedure is approximately:
     (1) Write GSM frame to the end of the file
     (2) Seek to the end of the file
     (3) Seek to the header
     (4) Update the file size
     (5) Seek (again) to the end of the file
     (6) Repeat
    
    This pattern negates any attempt to use the stdio buffering setup in
    ast_writefile. It also results in many small writes that require a seek going
    to the disk each second which translates to poor disk performance on certain
    file systems, particularly when there are multiple wav49 files being written
    simultaneously.
    
    (closes issue ASTERISK-19595)
    Reported by: Byron Clark
    Tested by: Byron Clark
    patches:
      gsm_wav_only_update_header_on_close.patch uploaded by byronclark (License 6157)
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
    16fd65bb
    History
    Improve disk writes for wav49 format
    Matthew Jordan authored
    Writing to a file in the wav49 format performs rather inefficiently. The
    procedure is approximately:
     (1) Write GSM frame to the end of the file
     (2) Seek to the end of the file
     (3) Seek to the header
     (4) Update the file size
     (5) Seek (again) to the end of the file
     (6) Repeat
    
    This pattern negates any attempt to use the stdio buffering setup in
    ast_writefile. It also results in many small writes that require a seek going
    to the disk each second which translates to poor disk performance on certain
    file systems, particularly when there are multiple wav49 files being written
    simultaneously.
    
    (closes issue ASTERISK-19595)
    Reported by: Byron Clark
    Tested by: Byron Clark
    patches:
      gsm_wav_only_update_header_on_close.patch uploaded by byronclark (License 6157)
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396412 65c4cc65-6c06-0410-ace0-fbb531ad65f3