Skip to content

Commit 6fed042

Browse files
committed
WIP
1 parent 615501d commit 6fed042

File tree

11 files changed

+240
-97
lines changed

11 files changed

+240
-97
lines changed

.github/actions/setup-rust/action.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Setup Test
2+
description: |
3+
This action sets up the environment for running tests in a Rust project.
4+
It installs Rust, sets up caching, and installs mise.
5+
6+
runs:
7+
using: composite
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Install rust
11+
shell: /bin/bash -l {0}
12+
run: rustup toolchain install stable --profile minimal --no-self-update
13+
- name: Setup Rust cache
14+
uses: Swatinem/rust-cache@v2
15+
with:
16+
cache-provider: buildjet
17+
cache-all-crates: true
18+
- uses: jdx/mise-action@v2
19+
with:
20+
version: 2025.1.0 # [default: latest] mise version to install
21+
install: true # [default: true] run `mise install`
22+
cache: true # [default: true] cache mise using GitHub's cache

.github/workflows/benchmark.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Benchmark Proxy
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
permissions:
15+
# deployments permission to deploy GitHub pages website
16+
deployments: write
17+
# contents permission to update benchmark contents in gh-pages branch
18+
contents: write
19+
20+
jobs:
21+
benchmark:
22+
name: Performance regression check
23+
runs-on: buildjet-16vcpu-ubuntu-2204
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: ./.github/actions/setup-test
27+
- run: |
28+
mise run postgres:up --extra-args "--detach --wait"
29+
- name: Run benchmark
30+
working-directory: tests/benchmark
31+
env:
32+
CS_WORKSPACE_ID: ${{ secrets.CS_WORKSPACE_ID }}
33+
CS_CLIENT_ACCESS_KEY: ${{ secrets.CS_CLIENT_ACCESS_KEY }}
34+
CS_DEFAULT_KEYSET_ID: ${{ secrets.CS_DEFAULT_KEYSET_ID }}
35+
CS_CLIENT_ID: ${{ secrets.CS_CLIENT_ID }}
36+
CS_CLIENT_KEY: ${{ secrets.CS_CLIENT_KEY }}
37+
RUST_BACKTRACE: "1"
38+
run: mise run benchmark:continuous
39+
# Download previous benchmark result from cache (if exists)
40+
- name: Download previous benchmark data
41+
uses: actions/cache@v4
42+
with:
43+
path: ./cache
44+
key: ${{ runner.os }}-benchmark
45+
# Run `github-action-benchmark` action
46+
- name: Store benchmark result
47+
uses: benchmark-action/github-action-benchmark@v1
48+
with:
49+
# What benchmark tool the output.txt came from
50+
tool: 'customSmallerIsBetter'
51+
# Where the output from the benchmark tool is stored
52+
output-file-path: tests/benchmark/results/output.json
53+
# Where the previous data file is stored
54+
external-data-json-path: ./cache/benchmark-data.json
55+
# Workflow will fail when an alert happens
56+
fail-on-alert: true
57+
# Enable alert commit comment
58+
comment-on-alert: true
59+
# GitHub API token to make a commit comment
60+
github-token: ${{ secrets.GITHUB_TOKEN }}
61+
# Enable Job Summary for PRs
62+
summary-always: true
63+
auto-push: true

.github/workflows/test.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test
1+
name: Test
22
on:
33
pull_request:
44
branches:
@@ -10,25 +10,14 @@ on:
1010

1111
env:
1212
CARGO_TERM_COLOR: always
13+
1314
jobs:
1415
test:
1516
name: Test
1617
runs-on: buildjet-16vcpu-ubuntu-2204
1718
steps:
1819
- uses: actions/checkout@v4
19-
- name: Install rust
20-
shell: /bin/bash -l {0}
21-
run: rustup toolchain install stable --profile minimal --no-self-update
22-
- name: Setup Rust cache
23-
uses: Swatinem/rust-cache@v2
24-
with:
25-
cache-provider: buildjet
26-
cache-all-crates: true
27-
- uses: jdx/mise-action@v2
28-
with:
29-
version: 2025.1.0 # [default: latest] mise version to install
30-
install: true # [default: true] run `mise install`
31-
cache: true # [default: true] cache mise using GitHub's cache
20+
- uses: ./.github/actions/setup-test
3221
- run: |
3322
mise run postgres:up --extra-args "--detach --wait"
3423
- env:

Cargo.toml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ edition = "2021"
1010
incremental = true
1111
debug = true
1212

13+
# [profile.dev.package]# aws-lc-sys.opt-level = 3
14+
# proc-macro2.opt-level = 3
15+
# quote.opt-level = 3
16+
# serde_derive.opt-level = 3
17+
# sqlparser.opt-level = 3
18+
# syn.opt-level = 3
19+
1320
[profile.dev.build-override]
1421
opt-level = 3
1522

@@ -20,7 +27,25 @@ debug = true
2027
[profile.release]
2128
codegen-units = 1
2229
strip = "symbols"
23-
lto = true
30+
31+
# Default release profile (https://doc.rust-lang.org/cargo/reference/profiles.html)
32+
# [profile.release]
33+
# opt-level = 3
34+
# debug = false
35+
# split-debuginfo = '...' # Platform-specific.
36+
# strip = "none"
37+
# debug-assertions = false
38+
# overflow-checks = false
39+
# lto = false
40+
# panic = 'unwind'
41+
# incremental = false
42+
# codegen-units = 16
43+
# rpath = false
44+
45+
[profile.profiling]
46+
inherits = "release"
47+
strip = "none"
48+
debug = true
2449

2550
[workspace.dependencies]
2651
sqlparser = { version = "^0.52", features = ["bigdecimal", "serde"] }

packages/cipherstash-proxy/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ uuid = { version = "1.11.0", features = ["serde", "v4"] }
5656
x509-parser = "0.17.0"
5757
vitaminc-protected = "0.1.0-pre2"
5858

59+
# [target.'cfg(not(target_env = "msvc"))'.dependencies]
60+
# jemallocator = "0.5.4"
5961

6062
[dev-dependencies]
6163
recipher = "0.1.3"

packages/cipherstash-proxy/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ use tokio::signal::unix::{signal, SignalKind};
1111
use tokio_util::task::TaskTracker;
1212
use tracing::{error, info, warn};
1313

14+
// #[cfg(not(target_env = "msvc"))]
15+
// use jemallocator::Jemalloc;
16+
17+
// #[cfg(not(target_env = "msvc"))]
18+
// #[global_allocator]
19+
// static GLOBAL: Jemalloc = Jemalloc;
20+
1421
const EQL_VERSION_AT_BUILD_TIME: Option<&'static str> = option_env!("EQL_VERSION_AT_BUILD_TIME");
1522

1623
fn main() -> Result<(), Box<dyn std::error::Error>> {

0 commit comments

Comments
 (0)