Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import sonic_platfrom_base takes more time in python3.11 compared to python3.9 #20574

Open
yuazhe opened this issue Oct 22, 2024 · 0 comments
Open

Comments

@yuazhe
Copy link
Contributor

yuazhe commented Oct 22, 2024

Description

Steps to reproduce the issue:

  1. time python -c "from sonic_platform_base.sonic_eeprom.eeprom_tlvinfo import TlvInfoDecoder"

Describe the results you received:

in 2405 it generates 320k func callings:

real    0m0.887s
user    0m0.769s
sys     0m0.116s

whereas in 2311, the above command generates only about 50k func callings:

real    0m0.379s
user    0m0.318s
sys     0m0.060s

From the flame graph it can be seen that pkgresources/setuptools had been called in 2405 but not in 2311, the only difference between them is the python version.
2405 import sonic_platfrom_common flame graph
imoprt_sonic_platform_common_2405

2311 import sonic_platfrom_common flame graph
import_sonic_platform_common_2311

Describe the results you expected:

The time should be close between 2311 and 2405

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant