-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into threading-refactor
- Loading branch information
Showing
72 changed files
with
5,149 additions
and
1,098 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Automatic Rebase | ||
on: | ||
issue_comment: | ||
types: [created] | ||
jobs: | ||
rebase: | ||
name: Rebase | ||
runs-on: ubuntu-latest | ||
if: >- | ||
github.event.issue.pull_request != '' && | ||
contains(github.event.comment.body, '/rebase') && | ||
( | ||
github.event.comment.author_association == 'MEMBER' || | ||
github.event.comment.author_association == 'OWNER' || | ||
github.event.comment.author_association == 'COLLABORATOR' | ||
) | ||
steps: | ||
- name: Checkout the latest code | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo | ||
- name: Automatic Rebase | ||
uses: cirrus-actions/rebase@1.8 | ||
with: | ||
autosquash: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use criterion::{black_box, criterion_group, criterion_main, Criterion}; | ||
use mpz_common::{ | ||
executor::{test_mt_executor, test_st_executor}, | ||
Context, | ||
}; | ||
use pollster::block_on; | ||
use scoped_futures::ScopedFutureExt; | ||
|
||
fn criterion_benchmark(c: &mut Criterion) { | ||
let mut group = c.benchmark_group("context"); | ||
|
||
// Measures the overhead of making a `Context::blocking` call, which | ||
// moves the context to a worker thread and back. | ||
group.bench_function("st/blocking", |b| { | ||
let (mut ctx, _) = test_st_executor(1024); | ||
b.iter(|| { | ||
block_on(async { | ||
ctx.blocking(|ctx| { | ||
async move { | ||
black_box(ctx.id()); | ||
} | ||
.scope_boxed() | ||
}) | ||
.await | ||
.unwrap(); | ||
}); | ||
}) | ||
}); | ||
|
||
// Measures the overhead of making a `Context::blocking` call, which | ||
// moves the context to a worker thread and back. | ||
group.bench_function("mt/blocking", |b| { | ||
let (mut exec_a, _) = test_mt_executor(8); | ||
|
||
let mut ctx = block_on(exec_a.new_thread()).unwrap(); | ||
|
||
b.iter(|| { | ||
block_on(async { | ||
ctx.blocking(|ctx| { | ||
async move { | ||
black_box(ctx.id()); | ||
} | ||
.scope_boxed() | ||
}) | ||
.await | ||
.unwrap(); | ||
}); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, criterion_benchmark); | ||
criterion_main!(benches); |
Oops, something went wrong.