All of lore.kernel.org
 help / color / mirror / Atom feed
* python3 recipe PGO tests
@ 2020-06-12 21:28 Ryan Rowe
  2020-06-12 21:37 ` Alexander Kanavin
  2020-06-15  1:05 ` [OE-core] " Anuj Mittal
  0 siblings, 2 replies; 8+ messages in thread
From: Ryan Rowe @ 2020-06-12 21:28 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org
  Cc: alex.kanavin@gmail.com, Martin Kelly, Jim Broadus

[-- Attachment #1: Type: text/plain, Size: 2024 bytes --]

Hello Alex,

I’m investigating Python 3 performance issues on a Raspberry Pi Yocto build; I appreciate any insights you can provide into the problem.

In my investigation, I noticed that PGO was disabled in all cases due to a small bug. I fixed it in a patch submitted to OE-Core (#139459<https://lists.openembedded.org/g/openembedded-core/message/139459>). Even when PGO is indeed enabled, Python 3 runs significantly slower on Yocto-compiled Python 3.8.3 than the same version compiled on Raspbian.

In your patch, 0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch<http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch>, I see that you override the default PROFILE_TASK, which did not explicitly specify test suites, to a command that explicitly provides test suites. How did you decide on these tests? The standard PGO command runs 43 tests, while you specify 7. When I compile Python 3.8.3 on Raspbian, I see no intersection between the 43 tests run by default and the 7 you specify. Additionally, the default module for PROFILE is test while you use test.regrtest.

For reference, here’s the results of a simple CPU-bound test. These tests were run on the same Raspberry Pi 4 with same SD card.

python3 -m timeit -r 10 --setup '
def fib(n):
 if n < 2:
   return n
 if n == 2:
   return 1
 return fib(n - 1) + fib(n - 2)
' '[fib(n) for n in range(20)]'

# Yocto Python 3.8.3
# 10 loops, best of 10: 28.9 msec per loop
# 10 loops, best of 10: 29.3 msec per loop
# 10 loops, best of 10: 27.9 msec per loop
# 10 loops, best of 10: 30.4 msec per loop
# Average result: 31.625 msec per loop

# Raspbian Python 3.8.3
# 50 loops, best of 10: 7.73 msec per loop
# 50 loops, best of 10: 7.72 msec per loop
# 50 loops, best of 10: 7.67 msec per loop
# 50 loops, best of 10: 7.74 msec per loop
# Average result: 7.715 msec per loop

# Raspbian speedup: 4.09x

Best,
Ryan Rowe

[-- Attachment #2: Type: text/html, Size: 6971 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-06-19  1:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-12 21:28 python3 recipe PGO tests Ryan Rowe
2020-06-12 21:37 ` Alexander Kanavin
2020-06-15  1:05 ` [OE-core] " Anuj Mittal
2020-06-15 20:33   ` Ryan Rowe
2020-06-18 23:24     ` Khem Raj
2020-06-18 23:47       ` Andre McCurdy
2020-06-18 23:56         ` Khem Raj
2020-06-19  1:30           ` Ryan Rowe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.