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

feat!: expose writer trait and common impls #1210

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

Oppen
Copy link
Member

@Oppen Oppen commented Jun 6, 2023

Re-exports bincode::enc::write::{Writer, SliceWriter} and implements
two ad-hoc writers for common use cases, VecWriter and BufWriter,
for writing to memory and an arbitrary std::io::Write (in a buffered
fashion), the latter enabled only with feature = std.

BREAKING: write_encoded_trace and write_encoded_memory use the new
trait.

TITLE

Description

Description of the pull request changes and motivation.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

Re-exports `bincode::enc::write::{Writer, SliceWriter}` and implements
two ad-hoc writers for common use cases, `VecWriter` and `BufWriter`,
for writing to memory and an arbitrary `std::io::Write` (in a buffered
fashion), the latter enabled only with `feature = std`.

BREAKING: `write_encoded_trace` and `write_encoded_memory` use the new
trait.
@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 13.105 ± 0.257 12.936 13.788 1.01 ± 0.02
head blake2s_integration_benchmark 12.995 ± 0.072 12.900 13.160 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.295 ± 0.029 4.257 4.348 1.00 ± 0.01
head compare_arrays_200000 4.290 ± 0.050 4.226 4.380 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.798 ± 0.015 2.776 2.824 1.00
head dict_integration_benchmark 2.822 ± 0.047 2.794 2.954 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 4.495 ± 0.016 4.475 4.528 1.00 ± 0.01
head factorial_multirun 4.495 ± 0.017 4.471 4.529 1.00
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 3.850 ± 0.034 3.811 3.916 1.00
head fibonacci_1000_multirun 3.859 ± 0.022 3.827 3.904 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 186.5 ± 4.2 182.8 196.1 1.02 ± 0.03
head field_arithmetic_get_square_benchmark 182.8 ± 2.5 181.6 189.7 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 12.012 ± 0.125 11.865 12.291 1.00
head integration_builtins 12.132 ± 0.245 11.884 12.618 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 13.590 ± 0.508 13.149 14.795 1.04 ± 0.04
head keccak_integration_benchmark 13.125 ± 0.204 12.979 13.665 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.299 ± 0.034 4.269 4.385 1.01 ± 0.01
head linear_search 4.252 ± 0.034 4.203 4.315 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.062 ± 0.012 3.048 3.081 1.00
head math_cmp_and_pow_integration_benchmark 3.073 ± 0.026 3.042 3.117 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.788 ± 0.013 2.774 2.822 1.00
head math_integration_benchmark 2.799 ± 0.019 2.779 2.840 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.434 ± 0.032 2.411 2.518 1.01 ± 0.01
head memory_integration_benchmark 2.417 ± 0.013 2.401 2.439 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.777 ± 0.032 2.753 2.846 1.01 ± 0.01
head operations_with_data_structures_benchmarks 2.758 ± 0.014 2.744 2.793 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 910.4 ± 2.9 906.6 914.4 1.00
head pedersen 912.1 ± 3.9 908.8 919.9 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.607 ± 0.061 1.580 1.781 1.01 ± 0.04
head poseidon_integration_benchmark 1.594 ± 0.004 1.587 1.600 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.478 ± 0.021 3.453 3.522 1.00
head secp_integration_benchmark 3.480 ± 0.020 3.463 3.533 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.590 ± 0.010 1.578 1.607 1.01 ± 0.01
head set_integration_benchmark 1.578 ± 0.009 1.568 1.600 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 8.295 ± 0.060 8.243 8.446 1.01 ± 0.01
head uint256_integration_benchmark 8.248 ± 0.021 8.217 8.283 1.00

@MegaRedHand
Copy link
Contributor

MegaRedHand commented Jun 21, 2023

NOTE: remember to update examples (currently only custom hint, see #1258) to use the exposed writers

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

Successfully merging this pull request may close these issues.

None yet

2 participants