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

Avoid using decimal.Decimal for integer values #315

Merged
merged 1 commit into from
May 2, 2023

Conversation

bbayles
Copy link
Contributor

@bbayles bbayles commented May 2, 2023

I did some profiling of this module with cProfile and found that the most expensive part of the dumps function is the number_to_string, which uses the decimal module.

This PR changes removes few calls to number_to_string where it's possible:

  • EXT-X-DISCONTINUITY-SEQUENCE is necessarily an integer, per RFC 8216
  • LAST-MSN
  • SKIPPED-SEGMENTS

Copy link
Member

@mauricioabreu mauricioabreu left a comment

Choose a reason for hiding this comment

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

Awesome, thank you!

@mauricioabreu mauricioabreu merged commit ca305e9 into globocom:master May 2, 2023
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