mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-22 18:33:56 +00:00
fix: test
This commit is contained in:
21
rust/benchmark/bench.ts
Normal file
21
rust/benchmark/bench.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Bench } from 'tinybench'
|
||||
|
||||
import { plus100 } from '../index.js'
|
||||
|
||||
function add(a: number) {
|
||||
return a + 100
|
||||
}
|
||||
|
||||
const b = new Bench()
|
||||
|
||||
b.add('Native a + 100', () => {
|
||||
plus100(10)
|
||||
})
|
||||
|
||||
b.add('JavaScript a + 100', () => {
|
||||
add(10)
|
||||
})
|
||||
|
||||
await b.run()
|
||||
|
||||
console.table(b.table())
|
||||
3
rust/benchmark/package.json
Normal file
3
rust/benchmark/package.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
10
rust/benchmark/tsconfig.json
Normal file
10
rust/benchmark/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "NodeNext",
|
||||
"module": "NodeNext",
|
||||
"outDir": "lib"
|
||||
},
|
||||
"include": ["."],
|
||||
"exclude": ["lib"]
|
||||
}
|
||||
Reference in New Issue
Block a user