[OE-core] [PATCH] python3: enable profile optimized builds

Andre McCurdy armccurdy at gmail.com
Thu Aug 16 19:31:34 UTC 2018


On Wed, Aug 15, 2018 at 11:26 PM, Anuj Mittal <anuj.mittal at intel.com> wrote:
> Enable profile guided optimization (pgo) for python3. Enabling pgo in
> python is generally as simple as invoking the target profile-opt which:
>
> - builds python binaries with profile instrumentation enabled,
> - runs a specific profile task using that python to get the profile
> data and,
> - feeds the compiler with this profile data and rebuilds python.
>
> This change invokes qemu-user for the second step of running a profile
> task using target python. Depending on how long profile task takes to
> run, this might add a significant time to compilation (which would be
> true for native builds too). The default profile task can be changed by
> the users depending on what makes sense for their use case (or can be
> left empty). In case qemu-user isn't supported, profile task won't be run.

Is it important to re-create the profile data during every build or
would we get most of the same benefits from using reference data which
is generated offline? How big is the data file? Is it binary or text?
Is the data expected to be target architecture specific?

If reference data were used, what are the consequences of the data not
corresponding exactly to the current build configuration? A build
failure? Or just a decrease in the effectiveness of the optimisation?

Does the profiling instrumentation measure execution timing? Or only
the frequency / order in which functions are called? ie is there any
concern that data generated from running under qemu may not be optimal
for running on the target?



More information about the Openembedded-core mailing list