Skip to content
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

Test buffers vs. counting emitter #36

Closed
misalcedo opened this issue Jul 21, 2021 · 3 comments
Closed

Test buffers vs. counting emitter #36

misalcedo opened this issue Jul 21, 2021 · 3 comments

Comments

@misalcedo
Copy link
Owner

misalcedo commented Jul 21, 2021

Benchmark the differences between writing to a buffer, then copying, vs. counting then writing again for emitting to binary.

@misalcedo
Copy link
Owner Author

Need to learn how to pass a dynamic output to the emit function in emit_section.

@misalcedo
Copy link
Owner Author

rust-lang/rust#68589

@misalcedo
Copy link
Owner Author

The counting emitter worked, but I had to remove the implicit Sized bound on most emit functions, though not all. The section ones still require a sized bound for now.

The benchmarks were inconclusive for the module buffer, but seemed to show improvements when removing the function buffer. I think the bigger win here is not having to determine a pre-allocation size for buffers. For larger modules this may prove beneficial as setting an initial capacity was the best perf improvement.

The section emitters need to be marked as sized in order for the emit_section to be able to cast O to dyn Write.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant