Skip to content

Commit

Permalink
feat(c++): BenchMark will be a Module (#2028)
Browse files Browse the repository at this point in the history
<!--
**Thanks for contributing to Fury.**

**If this is your first time opening a PR on fury, you can refer to
[CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).**

Contribution Checklist

- The **Apache Fury (incubating)** community has restrictions on the
naming of pr titles. You can also find instructions in
[CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).

- Fury has a strong focus on performance. If the PR you submit will have
an impact on performance, please benchmark it first and provide the
benchmark result here.
-->

## What does this PR do?
benchmark will be a module rather than a file

<img width="431" alt="image"
src="https://github.com/user-attachments/assets/59cad85d-3ee9-46ff-9d0f-b0109614cbce"
/>

<!-- Describe the purpose of this PR. -->

## Related issues
close  #2022
relate #2023 

<!--
Is there any related issue? Please attach here.

- #xxxx0
- #xxxx1
- #xxxx2
-->

## Does this PR introduce any user-facing change?

<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fury/issues/new/choose) describing the
need to do so and update the document if necessary.
-->

- [x] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark

<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
  • Loading branch information
pandalee99 authored Jan 27, 2025
1 parent a907a9a commit 1e63705
Show file tree
Hide file tree
Showing 6 changed files with 569 additions and 319 deletions.
20 changes: 19 additions & 1 deletion cpp/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
# Apache Fury™ C++

## How to build
Fury is a blazingly-fast multi-language serialization framework powered by just-in-time compilation and zero-copy.

## Build Fury C++

```bash
# Build all projects
bazel build //:all
# Run all tests
bazel test //:all
```

## Environment

- Bazel version: 6.3.2

## Benchmark

```bash
bazel build //cpp/fury/benchmark:all
bazel test //cpp/fury/benchmark:all
# You can also run a single benchmark to see how efficient it is.
# For example
bazel run //cpp/fury/benchmark:benchmark_string_util
```
24 changes: 24 additions & 0 deletions cpp/fury/benchmark/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")

cc_library(
name = "fury_benchmark",
srcs = glob(["*.cc"], exclude=["benchmark*.cc"]),
hdrs = glob(["*.h"]),
strip_include_prefix = "/cpp",
alwayslink = True,
linkstatic = True,
deps = [
"//cpp/fury/util:fury_util",
"@com_google_benchmark//:benchmark",
],
visibility = ["//visibility:public"],
)


cc_test(
name = "benchmark_string_util",
srcs = ["benchmark_string_util.cc"],
deps = [
":fury_benchmark",
],
)
Loading

0 comments on commit 1e63705

Please sign in to comment.