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

Michael Niedermayer michael at niedermayer.cc
Mon Jan 4 00:07:15 CET 2016

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
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

also about START/STOP_TIMER, the decicyles are tens of cycles so
one tenths of the displayed value is the amount of cpu cycles

iam sure if one looks at this from a different angle a quite different
threshold mathod and value could result

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- 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/ad4ed4b7/attachment.sig>

More information about the ffmpeg-devel mailing list