Skip to content

Fix Ion stream serialization in buffer write benchmarks - #455

Open
Shubham-Padkonde wants to merge 1 commit into
amazon-ion:masterfrom
Shubham-Padkonde:fix/ion-buffer-stream
Open

Shubham-Padkonde wants to merge 1 commit into
amazon-ion:masterfrom
Shubham-Padkonde:fix/ion-buffer-stream

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Issue #, if available: Related to #325 (Ion buffer-write support).

Description of changes:

Writing an Ion benchmark input containing 1 2 with --io-type buffer currently serializes [1, 2] as a single top-level Ion list. File mode writes the two original values, so the two modes measure different serialization workloads. Even a single top-level list acquires another list wrapper in buffer mode.

Pass sequence_as_stream=True to the benchmark wrapper's dumps, matching its existing dump implementation. This preserves empty streams, single values, multiple values, and a top-level list in text and binary output. It does not change the public simpleion default or address the other formats in #325.

All 75 benchmark CLI/spec tests pass on Python 3.9. The eight new regression cases fail before the fix and pass afterward; they compare buffer output with file output and repeat the benchmark call to check input reuse. Validation used the pure-Python Ion implementation; the C extension was unavailable locally.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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.

1 participant