-
Notifications
You must be signed in to change notification settings - Fork 8
Add Support for IonElement #69
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
Conversation
popematt
left a comment
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.
I have a few questions and suggestions, but overall this is looking pretty good.
| ``` | ||
| ion-java-benchmark read --api dom \ | ||
| --api ion_element_dom \ | ||
| example.10n | ||
| ``` |
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.
Just curious—when you run this, what sort of results to you get?
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.
It runs two APIs in sequence, then gives two stacked statistical summaries at the end, one for each API.
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.
Sorry, I should have been more clear. Approximately how much of a performance difference are you getting between the two APIs when you run this command?
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.
Approximately a 30-ish percentage improvement in primary_score. While this command is a rough comparison between two APIs, the result aligns well with our more extensive experiments run in SampleTime mode across three ion datasets, where we saw a ~37.09% improvement in primary_score.
src/com/amazon/ion/benchmark/CborJacksonMeasurableReadTask.java
Outdated
Show resolved
Hide resolved
src/com/amazon/ion/benchmark/JsonJacksonMeasurableReadTask.java
Outdated
Show resolved
Hide resolved
| * IonElement API. The "loader" is defined as any context that is tied to a single stream. | ||
| * @throws IOException if thrown during reading. | ||
| */ | ||
| abstract void fullyReadElementFromBuffer(SideEffectConsumer consumer) throws IOException; |
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.
Not a blocker—it would be nice if we could add new APIs to the benchmark CLI without having to add more methods for each one. (Especially since they are unlikely to be applicable for all data formats.) Have you thought about any ways this could be factored to make it more easily extensible?
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.
You're right, the current approach is a straightforward one but doesn't scale well. A capability-based system where each format declares which APIs it supports might be better. I'd be happy to refactor this in a follow-up if it's worth doing.
Co-authored-by: Matthew Pope <81593196+popematt@users.noreply.github.com>
Co-authored-by: Matthew Pope <81593196+popematt@users.noreply.github.com>
Co-authored-by: Matthew Pope <81593196+popematt@users.noreply.github.com>
Co-authored-by: Matthew Pope <81593196+popematt@users.noreply.github.com>
tgregg
left a comment
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.
It's looking good! Note the failing CI build.
Co-authored-by: Tyler Gregg <greggt@amazon.com>
Co-authored-by: Tyler Gregg <greggt@amazon.com>
Co-authored-by: Tyler Gregg <greggt@amazon.com>
tgregg
left a comment
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.
I'm excited to be able to use this to make the case for adoption of ion-element-kotlin over IonValue.
Once @popematt approves, we can squash/merge.
Summary
This PR adds support for the
ION_ELEMENT_DOMAPI to the ion-java-benchmark-cli, enabling benchmarking of the IonElement library from ion-element-kotlin alongside the existing STREAMING and DOM APIs.Changes
API.java)ION_ELEMENT_DOMenum value with documentationIonMeasurableReadTask.java)IonMeasurableWriteTask.java)generateWriteInstructionsElement()methodMeasurableReadTask.java&MeasurableWriteTask.java)ION_ELEMENT_DOMrouting ingetTask()andsetUpTrial()methodsMain.java)--apioption to includeion_element_domwith format restrictionspom.xml)OptionsTest.java)Performance Analysis
Evaluated on three Ion corpus datasets, including both Ion text and Ion binary data, IonElement shows an average of ~37.09% increase in
primary_scoreof performance compared to IonValue.