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

Move CsvMapper and Schema creation to constructor #4941

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

dinujoh
Copy link
Member

@dinujoh dinujoh commented Sep 11, 2024

Description

The CSV Processor is creating CsvMapper and CsvSchema for every record processed which is expensive as it can have a negative impact on the performance. The internal data structures consume memory, so creating a new instance on every request can increase the overall memory footprint.

Move CsvMapper and Schema creation to constructor.

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com>
dlvenable
dlvenable previously approved these changes Sep 11, 2024
Copy link
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

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

Nice catch!

Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com>
Copy link
Collaborator

@oeyh oeyh left a comment

Choose a reason for hiding this comment

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

Thanks!

@dlvenable dlvenable merged commit ed5ca4b into opensearch-project:main Sep 12, 2024
47 checks passed
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.

3 participants