-
Notifications
You must be signed in to change notification settings - Fork 116
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
Standard IO Interfaces #728
Conversation
rebased on master. |
Running some benchmarks (see the file-benchmark program), readers/writers blow ports out of the water in terms of performance (and the flexibility/composability is so much nicer!)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are a few comments, I'll give more later.
src/std/io/bio/api.ss
Outdated
@@ -39,7 +40,7 @@ | |||
(def (open-buffered-writer writer (buffer-size default-buffer-size)) | |||
(unless (Writer? writer) | |||
(error "Expected Writer instance" writer)) | |||
(BufferedWriter (make-output-buffer write (make-u8vector buffer-size) 0))) | |||
(BufferedWriter (make-output-buffer writer (make-u8vector buffer-size) 0))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw this should be the kind of error spotted by the new gsc
-warnings
flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with contracts (also planned for v18), maybe the gerbil compiler will also be able to catch it.
Improved benchmark program so that it is easier to reason about timings. InputInput Port
Reader
Buffered Reader
OutputOutput Port
Writer
Buffered Writer
|
Added 16K buffers to the benchmark; timings: buffered reader
buffered writer
|
Rebased on master and marked as ready for review; all that's missing is documentation -- Soon[TM] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reading the code, but already have questions on the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall nice
can use the unchecked methods
no need to recurse
- use inline methods - return smob buf to the cache - raise errors on bad continuation bytes
Rebased on master |
Will squash merge once CI is happy. |
Introduces the standard IO interfaces; see #724.
Follow up:
The interfaces look like this: