File tree 1 file changed +7
-2
lines changed 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,23 @@ pub fn main() !void {
6
6
7
7
const args = try std .process .argsAlloc (std .heap .page_allocator );
8
8
9
+ // Warm up runs
10
+ var buffer0 : [32767 ]u16 align (4096 ) = undefined ;
11
+ _ = try std .unicode .utf8ToUtf16Le (& buffer0 , args [1 ]);
12
+ _ = try std .unicode .utf8ToUtf16Le_better (& buffer0 , args [1 ]);
13
+
9
14
@fence (.SeqCst );
10
15
var timer = try std .time .Timer .start ();
11
16
@fence (.SeqCst );
12
17
13
- var buffer1 : [32767 ]u16 = undefined ;
18
+ var buffer1 : [32767 ]u16 align ( 4096 ) = undefined ;
14
19
_ = try std .unicode .utf8ToUtf16Le (& buffer1 , args [1 ]);
15
20
16
21
@fence (.SeqCst );
17
22
const elapsed_ns_orig = timer .lap ();
18
23
@fence (.SeqCst );
19
24
20
- var buffer2 : [32767 ]u16 = undefined ;
25
+ var buffer2 : [32767 ] u16 align ( 4096 ) = undefined ;
21
26
_ = try std .unicode .utf8ToUtf16Le_better (& buffer2 , args [1 ]);
22
27
23
28
@fence (.SeqCst );
You can’t perform that action at this time.
0 commit comments