[FFmpeg-devel] [PATCH 1/2] avformat/aviobuf: add ff_read_line_to_bprint and ff_read_line_to_bprint_overwrite functions

Nicolas George george at nsup.org
Wed Feb 14 14:52:40 EET 2018


Marton Balint (2018-02-11):
> It is a 500% speed improvement on a 260 MB line compared to using
> av_bprint_chars, so I'd rather leave it as is. I can add a comment saying
> "for performance reasons we fill a temporary buffer, and use av_bprint
> functions on chunks of data".

This is assuming reading the text file is the only thing that happens.
In practice, the lines will be parsed, tokenized, with probably quite a
few mallocs, making the overhead negligible. And if performance were
really critic, reading the file whole and splitting in memory would
probably be best.

But of course, since the optimization is already written and gives a
significant difference on pure tests, I have no objection as is.

Regards,

-- 
  Nicolas George


More information about the ffmpeg-devel mailing list