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

Benchmarks for Arrow IPC reader #7091

Merged
merged 1 commit into from
Feb 10, 2025
Merged

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Feb 6, 2025

Which issue does this PR close?

Rationale for this change

Similarly to #7090 we need a benchmark to show efforts to improve validation will actually speed it up.

What changes are included in this PR?

  1. Add ipc_reader benchmark for reading

Are there any user-facing changes?

No, this is only benchmark code

As you can see by the flamegraph, indeed most of the time is spent validating data (UTF8 validation specifically)

Screenshot 2025-02-06 at 3 35 34 PM

@github-actions github-actions bot added the arrow Changes to the arrow crate label Feb 6, 2025
});
}

// copied from the zero_copy_ipc example.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did want to benchmark using mmap as I think it is an important usecase

Maybe we should contemplate making this IPCBufferDecoder its own real API 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tustvold I would be particularly interested in your feedback on this idea (I can file ticket / work with someone to make the code but don't want to do it if you know of some reason not to)

Copy link
Contributor

Choose a reason for hiding this comment

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

I see no issue with this, the motivation for the lower level API was to support use-cases where people want to have more control over the IO (as opposed to just punting it to mmap). Having a more ergonomic API for the simple case, seems harmless to me

})
});

group.bench_function("FileReader/read_10/mmap", |b| {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The benchmark for mmap shows even more time spent in validating
Screenshot 2025-02-06 at 3 50 14 PM

flamegraph

@alamb alamb force-pushed the alamb/ipc_read_benchmark branch from 6cd7e5d to 7a6a00a Compare February 8, 2025 16:32
@alamb alamb marked this pull request as ready for review February 8, 2025 16:33
@alamb alamb merged commit d4432c0 into apache:main Feb 10, 2025
28 checks passed
@alamb
Copy link
Contributor Author

alamb commented Feb 10, 2025

Thank you @tustvold

@alamb alamb deleted the alamb/ipc_read_benchmark branch February 10, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add arrow-ipc benchmarks for the IPC reader and writer
2 participants