Skip to content

source jackson changes that got us 80 mb per sec#55892

Closed
Subodh Kant Chaturvedi (subodh1810) wants to merge 1 commit intomasterfrom
80-mb-sec-source
Closed

source jackson changes that got us 80 mb per sec#55892
Subodh Kant Chaturvedi (subodh1810) wants to merge 1 commit intomasterfrom
80-mb-sec-source

Conversation

@subodh1810
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Mar 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 21, 2025 5:26am

/**
* Parses command line args to a type safe config object for each command type.
*/
public class CliParse {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this class, this is just a copy paste (I was playing with some stuff)

implementation 'com.fasterxml.jackson.core:jackson-annotations:2.18.3'

// Jackson Afterburner module for performance optimizations
implementation 'com.fasterxml.jackson.module:jackson-module-afterburner:2.18.3'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This AfterBurner module is important

.configure(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN, true)
.registerModule(new JavaTimeModule())
.registerModule(new AfterburnerModule());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Register the after burner module

Comment on lines +29 to +32
try (SequenceWriter seqWriter = DummyIterator.OBJECT_MAPPER
.writerFor(AirbyteMessage.class)
.with(new MinimalPrettyPrinter(System.lineSeparator()))
.writeValues(System.out)) {
Copy link
Contributor Author

@subodh1810 Subodh Kant Chaturvedi (subodh1810) Mar 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Use a SequenceWriter
  2. Use the writeValues method
  3. Write directly to the output stream (System.out)
  4. Specify the POJO class that the writer is handling (AirbyteMessage)

AirbyteMessage message = iterator.next();
seqWriter.write(message);
// Should we flush after each record??
System.out.flush();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am not sure if we should flush after each method but since thats what we do with System.out.println, I just did it. I have not tested if there are any speed improvements if we dont flush after each record

@cgardens
Copy link
Contributor

We are closing this PR due to inactivity. We regularly close PRs that were created more than 6 months ago. If you'd like to keep working on it, please feel free reopen it. We'd be happy to keep working with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants