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
ZnBufferedReadWriteStream should handle better the buffer. #4726
ZnBufferedReadWriteStream should handle better the buffer. #4726
Conversation
…or writting and reading.
This fix improves the speed of loading code in around 20 times. |
Pablo you got some SDL 20 mixed inside (just a couple of methods). |
I wonder why we have code from MemoryFileStream in this PR. MemoryFileWriteStream >> next: anInteger putAll: aCollection startingAt: anInteger3 [
] |
The API of MemoryFileWriteStream was missing this method to be polymorphic with FileWriteStream |
More insight about the change. Basically it handles the writing and reading of small sectors accessing the disk. In a stock Pharo 8 image, the time to compile methods in a machine using emulated 512 bytes segments takes a lot of time: Object subclass: #Prb [20 timesRepeat: [ Prb compile: 'm2 "0:00:00:23.194" This problem is really clear when loading big projects, as compiling any class or method access the changes file. Moreover, this also improves the times in a machine without 4kb physical sector disks. When using the new solution that shares the buffer and improves the flushing handle the times get better: [20 timesRepeat: [ Prb compile: 'm2
|
The failing test seems unrelated. |
Creating a custom Buffered Read/Write Stream that shares the buffer for writing and reading.
In Windows, this is really important when using disks with physical segments of 4k.