Skip to content

Use the -O flag for improved performance in error handling #31

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

Open
adamamer20 opened this issue Jul 20, 2024 · 1 comment
Open

Use the -O flag for improved performance in error handling #31

adamamer20 opened this issue Jul 20, 2024 · 1 comment
Labels
enhancement Improvements to existing features or performance. good first issue Good for newcomers

Comments

@adamamer20
Copy link
Member

adamamer20 commented Jul 20, 2024

When running a python script with the -O flag, CPython doesn't compile the bytecode of

  • assert
  • if __debug__ code blocks

We might optimize "production-ready" models by converting errors to assertions or raising errors in an if __debug__ code block, while maintaining error handling capabilities during development and debugging.

@adamamer20 adamamer20 added the enhancement Improvements to existing features or performance. label Jul 20, 2024
@adamamer20 adamamer20 changed the title Covert Errors to Assertions Use the -O flag for performance Jul 21, 2024
@adamamer20 adamamer20 changed the title Use the -O flag for performance Use the -O flag for improved performance in error handling Jul 21, 2024
@adamamer20 adamamer20 added the good first issue Good for newcomers label Mar 18, 2025
@reyan-singh
Copy link
Collaborator

@adamamer20 @EwoutH fixed in PR #141

reyan-singh added a commit to reyan-singh/mesa-frames that referenced this issue Mar 29, 2025
reyan-singh added a commit to reyan-singh/mesa-frames that referenced this issue Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features or performance. good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants