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

Improve performance of SerializableType class #52

Merged
merged 2 commits into from
Apr 27, 2022
Merged

Improve performance of SerializableType class #52

merged 2 commits into from
Apr 27, 2022

Conversation

ThibFrgsGmz
Copy link
Contributor

@ThibFrgsGmz ThibFrgsGmz commented Apr 9, 2022

Originating Project/Creator
Affected Component
Affected Architectures(s)
Related Issue(s)
Has Unit Tests (y/n)
Builds Without Errors (y/n)
Unit Tests Pass (y/n)
Documentation Included (y/n)

Change Description

The SerializableType.formatted function has been refactored to include the following changes:

  • Inline variable that is immediately returned ref
  • Replace dict() with {} ref
  • Convert the for loop to dictionary comprehension ref
  • Replace if statement with if-expression ref

The SerializableType.getSize function has been refactored to include the following change:

  • Replace unneeded comprehension with generator ref

Rationale

Improve the performance of the python autocoder.

Testing/Review Recommendations

(void)

Future Work

(void)

- Inline variable that is immediately returned
- Replace dict() with {}
- Convert for loop into dictionary comprehension
- Replace if statement with if expression
-> Replace unneeded comprehension with generator
Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@LeStarch LeStarch merged commit d5bb305 into nasa:devel Apr 27, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants