Skip to content

Improve indexOf() performance in DefaultFieldSet #4931

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

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

Conversation

cwangg897
Copy link

Replaced linear List#indexOf with a precomputed Map-based index lookup This reduces the time complexity from O(n) to O(1), improving performance for field lookups in wide CSV files. This change preserves existing behavior and error messages

Resolves: #4930

@cwangg897 cwangg897 force-pushed the perf/fieldset-indexof-optimization branch from c5505ca to 44b758e Compare July 27, 2025 11:11
Replaced linear List#indexOf with a precomputed Map-based index lookup
This reduces the time complexity from O(n) to O(1), improving performance
for field lookups in wide CSV files. This change preserves existing
behavior and error messages

Resolves: spring-projects#4930

Signed-off-by: Choi Wang Gyu <[email protected]>
@cwangg897 cwangg897 force-pushed the perf/fieldset-indexof-optimization branch from 44b758e to 4e2f14b Compare July 27, 2025 11:14
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.

Performance improvement: Optimize DefaultFieldSet.indexOf() method
1 participant