-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: performance regression test の導入 (#107)
* feat: add performance testing * fix: testing failed to create complex object for testing * refactor: remove describe block * fix: bench実施処理を最適化 * fix: bench の一部がコケる問題を暫定的に対処 * misc: ついでのテストケース追加 * feat: codspeed 追加 * fix: こまい action 修正 * Create ninety-pens-suffer.md * fix: 不要なコメントの削除 * fix: テスト縮小 * fix: テスト縮小
- Loading branch information
Showing
24 changed files
with
1,322 additions
and
751 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,5 @@ | ||
--- | ||
"json-origami": patch | ||
--- | ||
|
||
unfold 関数にて、値が空配列・空オブジェクトのときに値が結果に反映されない問題の修正 |
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,36 @@ | ||
name: Codspeed Benchmarks | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
pull-requests: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
|
||
jobs: | ||
init__node: | ||
if: | | ||
!contains(github.event.pull_request.labels.*.name, 'renovate') | ||
name: "Initialize: node" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/init-node | ||
|
||
benchmarks: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- init__node | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/init-node | ||
|
||
- name: Run benchmarks | ||
uses: CodSpeedHQ/action@v2 | ||
with: | ||
run: yarn bench | ||
token: ${{ secrets.CODSPEED_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
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,36 @@ | ||
import { bench, describe } from 'vitest' | ||
import { | ||
createRandomObject, | ||
BENCHMARK_TARGET_OBJECT_VALUES, | ||
BENCHMARK_TARGET_LIGHT_OBJECT_VALUES | ||
} from './utils' | ||
import { fold } from '../src/fold' | ||
|
||
const iterations = 10 | ||
|
||
interface TestCaseOption { | ||
/** | ||
* 生成するオブジェクトの値の数 | ||
*/ | ||
objectValues: number | ||
} | ||
|
||
function runBench({ objectValues }: TestCaseOption) { | ||
const objects = Array.from({ length: iterations }, () => | ||
createRandomObject({ leafs: objectValues }) | ||
) | ||
let index = 0 | ||
|
||
bench(`fold (complex object including ${objectValues} values)`, () => { | ||
const object = objects[index++ % iterations] | ||
fold(object) | ||
}) | ||
} | ||
|
||
describe('fold with light object', () => { | ||
runBench({ objectValues: BENCHMARK_TARGET_LIGHT_OBJECT_VALUES }) | ||
}) | ||
|
||
describe('fold with heavy object', () => { | ||
runBench({ objectValues: BENCHMARK_TARGET_OBJECT_VALUES }) | ||
}) |
Oops, something went wrong.