Commit 1f379d0 1 parent 894290b commit 1f379d0 Copy full SHA for 1f379d0
File tree 3 files changed +10
-5
lines changed
opentelemetry-sdk/benches
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ fn counter_add(c: &mut Criterion) {
54
54
c. bench_function ( "Counter_Add_Sorted" , |b| {
55
55
b. iter ( || {
56
56
// 4*4*10*10 = 1600 time series.
57
- let rands = CURRENT_RNG . with_borrow_mut ( |rng| {
57
+ let rands = CURRENT_RNG . with ( |rng| {
58
+ let mut rng = rng. borrow_mut ( ) ;
58
59
[
59
60
rng. gen_range ( 0 ..4 ) ,
60
61
rng. gen_range ( 0 ..4 ) ,
@@ -81,7 +82,8 @@ fn counter_add(c: &mut Criterion) {
81
82
c. bench_function ( "Counter_Add_Unsorted" , |b| {
82
83
b. iter ( || {
83
84
// 4*4*10*10 = 1600 time series.
84
- let rands = CURRENT_RNG . with_borrow_mut ( |rng| {
85
+ let rands = CURRENT_RNG . with ( |rng| {
86
+ let mut rng = rng. borrow_mut ( ) ;
85
87
[
86
88
rng. gen_range ( 0 ..4 ) ,
87
89
rng. gen_range ( 0 ..4 ) ,
@@ -118,7 +120,8 @@ fn counter_add(c: &mut Criterion) {
118
120
119
121
c. bench_function ( "ThreadLocal_Random_Generator_5" , |b| {
120
122
b. iter ( || {
121
- let _i1 = CURRENT_RNG . with_borrow_mut ( |rng| {
123
+ let __i1 = CURRENT_RNG . with ( |rng| {
124
+ let mut rng = rng. borrow_mut ( ) ;
122
125
[
123
126
rng. gen_range ( 0 ..4 ) ,
124
127
rng. gen_range ( 0 ..4 ) ,
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ fn main() {
45
45
46
46
fn test_counter ( ) {
47
47
let len = ATTRIBUTE_VALUES . len ( ) ;
48
- let rands = CURRENT_RNG . with_borrow_mut ( |rng| {
48
+ let rands = CURRENT_RNG . with ( |rng| {
49
+ let mut rng = rng. borrow_mut ( ) ;
49
50
[
50
51
rng. gen_range ( 0 ..len) ,
51
52
rng. gen_range ( 0 ..len) ,
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ fn main() {
25
25
}
26
26
27
27
fn test_random_generation ( ) {
28
- let _i1 = CURRENT_RNG . with_borrow_mut ( |rng| {
28
+ let _i1 = CURRENT_RNG . with ( |rng| {
29
+ let mut rng = rng. borrow_mut ( ) ;
29
30
[
30
31
rng. gen_range ( 0 ..10 ) ,
31
32
rng. gen_range ( 0 ..10 ) ,
You can’t perform that action at this time.
0 commit comments