File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ const common = require('../common.js');
44const bench = common . createBenchmark ( main , {
55 bytes : [ 8 , 128 , 1024 ] ,
66 partial : [ 'true' , 'false' ] ,
7+ shared : [ 'true' , 'false' ] ,
78 n : [ 6e6 ] ,
89} ) ;
910
10- function main ( { n, bytes, partial } ) {
11- const source = Buffer . allocUnsafe ( bytes ) ;
12- const target = Buffer . allocUnsafe ( bytes ) ;
11+ function main ( { n, bytes, partial, shared } ) {
12+ const source = shared === 'true' ? Buffer . from ( new SharedArrayBuffer ( bytes ) ) : Buffer . allocUnsafe ( bytes ) ;
13+ const target = shared === 'true' ? Buffer . from ( new SharedArrayBuffer ( bytes ) ) : Buffer . allocUnsafe ( bytes ) ;
1314 const sourceStart = ( partial === 'true' ? Math . floor ( bytes / 2 ) : 0 ) ;
1415 bench . start ( ) ;
1516 for ( let i = 0 ; i < n ; i ++ ) {
You can’t perform that action at this time.
0 commit comments