-
Notifications
You must be signed in to change notification settings - Fork 101
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
Display optimizations (between 2x00 and 8x00 times faster) (ignore, superseded by #160) #158
Commits on Jun 17, 2022
-
Upgrade pyperf (drop support for Python 2.x)
Since 0.8.1 pyte does not support Python 2.x anymore so it makes sense to upgrade one of its dev dependencies, pyperf.
Configuration menu - View commit details
-
Copy full SHA for 8513fe8 - Browse repository at this point
Copy the full SHA 8513fe8View commit details -
Allow change the screen geometry
Receive via environ the geometry of the screen to test with a default of 24 lines by 80 columns. Add this and the input file into Runner's metadata so it is preserved in the log file (if any)
Configuration menu - View commit details
-
Copy full SHA for cabc0a5 - Browse repository at this point
Copy the full SHA cabc0a5View commit details -
Impl benchmark tests for screen.display, .reset and .resize
Implement three more benchmark scenarios for testing screen.display, screen.reset and screen.resize. For the standard 24x80 geometry, these methods have a negligible cost however of larger geometries, they can be up to 100 times slower than stream.feed so benchmarking them is important. Changed how the metadata is stored so on each bench_func call we encode which scenario are we testing, with which screen class and geometry.
Configuration menu - View commit details
-
Copy full SHA for 940e19b - Browse repository at this point
Copy the full SHA 940e19bView commit details
Commits on Jun 18, 2022
-
Impl script to run a full benchmark
A shell script to test all the captured input files and run them under different terminal geometries (24x80, 240x800, 2400x8000, 24x8000 and 2400x80). These settings aim to stress pyte with larger and larger screens (by a 10 factor on both dimensions and on each dimension separately).
Configuration menu - View commit details
-
Copy full SHA for 0b8007a - Browse repository at this point
Copy the full SHA 0b8007aView commit details
Commits on Jul 2, 2022
-
Fix benchmark.py using ByteStream and not Stream
The input files in the tests/captured must be loaded with ByteStream and not Stream, otherwise the \r are lost and the benchmark results may not reflect real scenarios.
Configuration menu - View commit details
-
Copy full SHA for e0b0e8b - Browse repository at this point
Copy the full SHA e0b0e8bView commit details
Commits on Jul 4, 2022
-
Configuration menu - View commit details
-
Copy full SHA for eec4a2e - Browse repository at this point
Copy the full SHA eec4a2eView commit details -
display meth: iterate over data entries filling the gap between
The former `for x in range(...)` implementation iterated over the all the possibly indexes (for columns and lines) wasting cyclies because some of those indexes (and in some cases most) pointed to non-existing entries. These non-existing entries were faked and a default character was returned in place. This commit instead makes display to iterate over the existing entries. When gaps between to entries are detected, the gap is filled with the same default character without having to pay for indexing non-entries. Note: I found that in the current implementation of screen, screen.buffer may have entries (chars in a line) outside of the width of the screen. At the display method those are filtered out however I'm not sure if this is not a real bug that was uncovered because never we iterated over the data entries. If this is true, we may be wasting space as we keep in memory chars that are outside of the screen.
Configuration menu - View commit details
-
Copy full SHA for f899535 - Browse repository at this point
Copy the full SHA f899535View commit details -
Inline generator into display inner loop
Python generators (yield) and function calls are slower then normal for-loops. Improve screen.display by x1 to x1.8 times faster by inlining the code.
Configuration menu - View commit details
-
Copy full SHA for b3b7db4 - Browse repository at this point
Copy the full SHA b3b7db4View commit details -
The assert that checks the width of each char is removed from screen.display and put it into the tests. This ensures that our test suite maintains the same quality and at the same time we make screen.display ~x1.7 faster.
Configuration menu - View commit details
-
Copy full SHA for de59245 - Browse repository at this point
Copy the full SHA de59245View commit details -
Instead of computing it on each screen.display, compute the width of the char once on screen.draw and store it in the Char tuple. This makes screen.display ~x1.10 to ~x1.20 faster and it makes stream.feed only ~x1.01 slower in the worst case. This negative impact is due the change on screen.draw but measurements on my lab show inconsistent results (stream.feed didn't show a consistent performance regression and ~x1.01 slower was the worst value that I've got).
Configuration menu - View commit details
-
Copy full SHA for 020fce6 - Browse repository at this point
Copy the full SHA 020fce6View commit details