-
Notifications
You must be signed in to change notification settings - Fork 127
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
Port ser::Serializer
to io::Write
#206
Conversation
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.
Thank you, great stuff! Just a few fixes needed
It's hard to look through your logic changes because of the formatting changes. Is there a way you could separate these in commits? |
In case you didn't get a notification, I've separated the commits |
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.
First commit review.
It's looks great in general!
Just one major concern to address.
So there were a couple things that came up while writing this that will need to be resolved: Lines 178 to 185 in 92c1d5d
The serializer emits CRLF newlines on windows but the tests don't expect them, meaning the test quite can only be run on linux. This isn't going to be hard to solve ^^ Line 58 in 92c1d5d
At some point this test was broken, presumably by a |
I think this looks good now! Thank you! |
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.
Thank you!
bors r+
206: feat: port `ser::Serializer` to `io::Write` r=kvark a=Plecra Makes the `Serializer` struct generic over `io::Write`, allowing it to be used with more types (and less allocation). As a side-effect, the trailing commas are also removed from the output. This was a quick implementation, written in response to compiler messages, so it could probably do with some cleaning up. It might be a good time to approach #175 Closes #202 ## TODO - [ ] Update docs Co-authored-by: Marli Frost <[email protected]>
Ah, I just remembered! I think we can avoid this being a breaking change by using At this point, it's probably best to just make this |
Yes, I agree, let's not try too hard to make this backwards compatible. |
Timed out. |
The CI isn't happy - https://travis-ci.org/github/ron-rs/ron |
It is not. I should've realized this was actually caused by my changes - using an I've remade the original fix to the test. Line 58 in 7ec65de
|
ser::Serializer
to io::Write
ser::Serializer
to io::Write
ser::Serializer
to io::Write
ser::Serializer
to io::Write
Is this all ready? Could you rebase please? |
Updated! |
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.
Thank you!
bors r+
Build succeeded: |
I've been using cargo-llvm-lines to look at compile times of webrender, in particular when the There was a 13% increase in the number of lines of LLVM IR generated with the Here's some of the output from cargo-llvm-lines with 0.5.1:
And here's the corresponding output with 0.6.0:
This PR added the If you want to try this yourself:
The non-obvious lesson here is that these methods can be instantiated very often, and so adding features/complexity can have surprisingly high costs. |
Reviewing the changes, I think the regressions may be primarily due to the error handling and Doing that would also remove the awkward |
|
@Plecra: LLVM IR generation occurs before any inlining happens, so inlining isn't relevant. As I said above, I think the introduction of |
@Plecra I added a workaround for the bug in |
Makes the
Serializer
struct generic overio::Write
, allowing it to be used with more types (and less allocation). As a side-effect, the trailing commas are also removed from the output.This was a quick implementation, written in response to compiler messages, so it could probably do with some cleaning up. It might be a good time to approach #175
Closes #202
TODO