Fix readstring benchmark, add readfloat64. #223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
g["read"]
andg["readstring"]
were using the sametestbuf
, which would be at end-of-file after either one was run.The real reason for this PR is adding the
Float64
benchmark though; I just found thereadstring
issue in the process. I'm quite unhappy with the fact that reading (and writing, but that's for a later time) primitive types allocates. I thought that maybe this would be resolved in 0.7 (elimination of the allocation of theRef
here), but I guess that's being explicitly prevented by the@noinline
here.BufferedStreams.jl has this implementation, which doesn't allocate. Is something like this acceptable for Base as well?
Result of running
run(g["readfloat64"])
on my machine: