Skip to content

[cmis] Optimize cmis.get_error_description speed for passive module#526

Merged
prgeor merged 1 commit intosonic-net:masterfrom
Junchao-Mellanox:master-optimize-error-desc
Jan 28, 2025
Merged

[cmis] Optimize cmis.get_error_description speed for passive module#526
prgeor merged 1 commit intosonic-net:masterfrom
Junchao-Mellanox:master-optimize-error-desc

Conversation

@Junchao-Mellanox
Copy link
Contributor

Description

cmis.get_error_description is very slow for passive module:

>>> begin = time.time()
>>> s.get_error_description()
'ModuleLowPwr'
>>> print(time.time() - begin)
2.905252695083618

For a module that has flat memory, it does not need check data path state. Because of this issue, show error-status --fetch-from-hardware takes very long time if there are many passive modules present:

real    1m12.116s
user    0m5.852s
sys     0m15.491s

After the fix, it changes to:

real    0m1.051s
user    0m0.499s
sys     0m0.059s

Motivation and Context

Optimize cmis.get_error_description for passive module

How Has This Been Tested?

Manual test
Unit test

Additional Information (Optional)

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox Junchao-Mellanox force-pushed the master-optimize-error-desc branch from aacda6b to 8eb3462 Compare December 25, 2024 08:45
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants