-
Notifications
You must be signed in to change notification settings - Fork 35
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
Proposal (WIP): PushReader, a simpler reader API #113
base: master
Are you sure you want to change the base?
Conversation
da76a35
to
71de8bb
Compare
Shouldn't this be called WriterReader? "Push" seems to imply streaming to me. |
or "WriteReader" maybe |
I'd worry about |
But I'll think more about naming. |
I agree. We should probably be consistent about what the prefix and suffix is. For example, if the suffix indicated the data flow (i.e., we should have called it FuncReader instead of ReaderFunc), then this would be clearer I think.. |
I would fully support having this functionality. It vastly simplifies ReaderFunc() |
71de8bb
to
434562a
Compare
I haven't thought more about naming yet, but I wrote a basic in-memory benchmark with a trivial reader task. Very roughly, it seems ~30% slower. Perhaps for a non-trivial program, this 30% extra overhead may be insignificant compared to the readability advantage. |
I vectorized channel operations, which has a minor (if any) effect on the existing benchmarks, but intuitively may help when there's more parallelism. I added a benchmark to demonstrate that the overhead involved is minimal if each row computation does more work, which might make this suitable for several GRAIL-internal usages. As @jcharum pointed out, there's still some In terms of naming: most of the existing |
This is a concept for making data reading simpler than
ReaderFunc
by allowing "normal" Go state (in a closure).The performance cost of this may be significant; I haven't measured yet. I wanted to start by having a concrete example of what user code will look like.