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

Optimization: RAW display block read #783

Merged
merged 1 commit into from Feb 1, 2024

Conversation

penguinolog
Copy link
Collaborator

Instead of reading per-byte, we can read per-chunk and make fewer read cycles. With chunk size 1024 bytes, we have almost 100% warranty of single-cycle buffer read

Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

Instead of reading per-byte, we can read per-chunk and make fewer read cycles.
With chunk size 1024 bytes, we have almost 100% warranty of single-cycle buffer read
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7738568816

  • -22 of 27 (18.52%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 70.968%

Changes Missing Coverage Covered Lines Changed/Added Lines %
urwid/display/_raw_display_base.py 1 3 33.33%
urwid/display/_posix_raw_display.py 2 12 16.67%
urwid/display/_win32_raw_display.py 2 12 16.67%
Totals Coverage Status
Change from base Build 7725240357: -0.1%
Covered Lines: 8769
Relevant Lines: 12447

💛 - Coveralls

@penguinolog penguinolog merged commit 102b3ba into urwid:master Feb 1, 2024
35 checks passed
@penguinolog penguinolog deleted the raw_input_optimizations branch February 1, 2024 09:32
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.

None yet

2 participants