[FFmpeg-devel] [RFC] Disable compile-time tablegen for cbrt if total cycle count < 200000

Michael Niedermayer michael at niedermayer.cc
Mon Jan 4 00:21:40 CET 2016


On Mon, Jan 04, 2016 at 12:07:15AM +0100, Michael Niedermayer wrote:
> On Fri, Jan 01, 2016 at 08:07:39AM -0800, Ganesh Ajjanagadde wrote:
> > Hi all,
> > 
> > Motivated by a remark by Ronald:
> > https://ffmpeg.org/pipermail/ffmpeg-devel/2016-January/186200.html,
> > this is a request for comment on disabling compile time tablegen for
> > cbrt if the total cycle count < 200000. Note that cbrt tables are only
> > used in aacdec.
> 
> Its very hard to state a hard number as the threshold, this is quite
> subjective
> and different viewpoints would lead to different results
> 
> but lets try anyway
> for the hardcoded table case more data needs to be read from disk
> ATM this is about 2mb for all tables
> 
> for dynamic tables the used tables need to be generated
> theres a difference in binary size (table size vs code to generate it),
> that translates into a cost value (bytes * cycles_per_byte)
> 
> and the dynamic init needs some time to build the table, thats
> conveniently already in cycles
> 
> (above ignores alot, like HDDs, SDDs disk cache have different speed
>  hardcoded tables can be shared between processes but then rarely would
>  a process use all tables while the OS might end up loading all anyway
>  also we assume a load from cache while a OS might actually map tables
>  from the disk cache directly)
> 
> now if the dynamic init is faster than loading the table from
> the disk cache then dynamic init is likely the better choice
> 

> using cat into /dev/null i get about 2bytes per cycle

to make this more complex
if the whole binary is read on init then all tables would need to be
loaded while for a use case of repeated execution of ffmpeg only
the tables needed for a single file would need to be build

(the repeated execution is where the init time matters most)

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160104/adfff3a5/attachment.sig>


More information about the ffmpeg-devel mailing list