-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: config perf test env, add perf test case and report #6194
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
229 changes: 229 additions & 0 deletions
229
packages/g6/__tests__/perf-report/9821ed36_2024-08-19_16:33:46.json
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,229 @@ | ||
{ | ||
"version": "1.0", | ||
"device": { | ||
"os": { | ||
"arch": "arm64", | ||
"distro": "macOS", | ||
"serial": "9821ed36011eee5abf6c71d6fc2c03fb4bf4655e674c56b7f50e2560cb6e924a" | ||
}, | ||
"cpu": { | ||
"manufacturer": "Apple", | ||
"brand": "M1 Pro", | ||
"speed": 2.4, | ||
"cores": 10 | ||
}, | ||
"memory": { | ||
"total": 16384, | ||
"free": 58.015625 | ||
}, | ||
"gpu": { | ||
"vendor": "Apple", | ||
"model": "Apple M1 Pro", | ||
"cores": "16" | ||
} | ||
}, | ||
"repo": "ab97b6a84c9b1ac7f599e34568714376278583f0", | ||
"client": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36", | ||
"reports": { | ||
"dataDiff1000": { | ||
"time": [ | ||
{ | ||
"min": 1.8999999999068677, | ||
"max": 9, | ||
"median": 2.8999999999068677, | ||
"avg": 7.25, | ||
"variance": 32.390000000039585, | ||
"reliable": false, | ||
"memory": 30.162158966064453, | ||
"key": "data diff" | ||
} | ||
], | ||
"status": "passed" | ||
}, | ||
"dataDiff10000": { | ||
"time": [ | ||
{ | ||
"min": 12.199999999953434, | ||
"max": 7.900000000139698, | ||
"median": 6.7999999998137355, | ||
"avg": 6.324999999982538, | ||
"variance": 1.35437500005326, | ||
"reliable": true, | ||
"memory": 62.23182191848755, | ||
"key": "data diff" | ||
} | ||
], | ||
"status": "passed" | ||
}, | ||
"dataDiff100000": { | ||
"time": [ | ||
{ | ||
"min": 29.300000000046566, | ||
"max": 67.10000000009313, | ||
"median": 36.10000000009313, | ||
"avg": 35.64999999999418, | ||
"variance": 16.877500000362634, | ||
"reliable": true, | ||
"memory": 369.5241134643555, | ||
"key": "data diff" | ||
} | ||
], | ||
"status": "passed" | ||
}, | ||
"dataDiff5000": { | ||
"time": [ | ||
{ | ||
"min": 2.6000000000931323, | ||
"max": 7.599999999860302, | ||
"median": 3, | ||
"avg": 3.5125000000116415, | ||
"variance": 2.188593750007858, | ||
"reliable": false, | ||
"memory": 585.6023946762085, | ||
"key": "data diff" | ||
} | ||
], | ||
"status": "passed" | ||
}, | ||
"dataDiff50000": { | ||
"time": [ | ||
{ | ||
"min": 13.699999999953434, | ||
"max": 55.199999999953434, | ||
"median": 17.600000000093132, | ||
"avg": 22.66250000000582, | ||
"variance": 132.55484375006213, | ||
"reliable": true, | ||
"memory": 722.3826655387878, | ||
"key": "data diff" | ||
} | ||
], | ||
"status": "passed" | ||
}, | ||
"elementDrawing100": { | ||
"time": [ | ||
{ | ||
"min": 10.5, | ||
"max": 9.5, | ||
"median": 15.800000000046566, | ||
"avg": 16.57500000006985, | ||
"variance": 163.99937499927708, | ||
"reliable": true, | ||
"memory": 826.2329563140869, | ||
"key": "element drawing" | ||
}, | ||
{ | ||
"min": 10.399999999906868, | ||
"max": 8.5, | ||
"median": 7.7999999998137355, | ||
"avg": 8.450000000011642, | ||
"variance": 4.637500000128056, | ||
"reliable": true, | ||
"memory": 826.4959269523621, | ||
"key": "grid layout" | ||
} | ||
], | ||
"status": "passed" | ||
}, | ||
"elementDrawing1000": { | ||
"time": [ | ||
{ | ||
"min": 100.79999999981374, | ||
"max": 84.69999999995343, | ||
"median": 117.39999999990687, | ||
"avg": 100.46250000002328, | ||
"variance": 255.6148437497992, | ||
"reliable": true, | ||
"memory": 830.0374026298523, | ||
"key": "element drawing" | ||
}, | ||
{ | ||
"min": 59.5999999998603, | ||
"max": 77.29999999981374, | ||
"median": 67.30000000004657, | ||
"avg": 66.9375000000291, | ||
"variance": 12.824843750080472, | ||
"reliable": true, | ||
"memory": 829.3771424293518, | ||
"key": "grid layout" | ||
} | ||
], | ||
"status": "passed" | ||
}, | ||
"elementDrawing10000": { | ||
"time": [ | ||
{ | ||
"min": 416.30000000004657, | ||
"max": 649.0999999998603, | ||
"median": 596.5, | ||
"avg": 593.7874999999185, | ||
"variance": 450.70359375090015, | ||
"reliable": true, | ||
"memory": 1099.1369720458983, | ||
"key": "element drawing" | ||
}, | ||
{ | ||
"min": 352.60000000009313, | ||
"max": 377.70000000018626, | ||
"median": 366.5, | ||
"avg": 366.3125, | ||
"variance": 5.318593750001164, | ||
"reliable": true, | ||
"memory": 1131.638009262085, | ||
"key": "grid layout" | ||
} | ||
], | ||
"status": "passed" | ||
}, | ||
"elementDrawing500": { | ||
"time": [ | ||
{ | ||
"min": 126.39999999990687, | ||
"max": 49.60000000009313, | ||
"median": 42.300000000046566, | ||
"avg": 40.97500000000582, | ||
"variance": 7.959374999943247, | ||
"reliable": true, | ||
"memory": 1362.0711398124695, | ||
"key": "element drawing" | ||
}, | ||
{ | ||
"min": 29.300000000046566, | ||
"max": 42.89999999990687, | ||
"median": 34.39999999990687, | ||
"avg": 34.299999999959255, | ||
"variance": 5.03999999981257, | ||
"reliable": true, | ||
"memory": 1362.0711398124695, | ||
"key": "grid layout" | ||
} | ||
], | ||
"status": "passed" | ||
}, | ||
"elementDrawing5000": { | ||
"time": [ | ||
{ | ||
"min": 381.19999999995343, | ||
"max": 548.1999999999534, | ||
"median": 408.80000000004657, | ||
"avg": 428.375, | ||
"variance": 1986.7618749965764, | ||
"reliable": true, | ||
"memory": 1483.8886072158814, | ||
"key": "element drawing" | ||
}, | ||
{ | ||
"min": 208.19999999995343, | ||
"max": 291.80000000004657, | ||
"median": 264.60000000009313, | ||
"avg": 262.70000000001164, | ||
"variance": 166.63749999852735, | ||
"reliable": true, | ||
"memory": 1479.9850234985352, | ||
"key": "grid layout" | ||
} | ||
], | ||
"status": "passed" | ||
} | ||
} | ||
} |
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,33 @@ | ||
import { Graph } from '@antv/g6'; | ||
import type { Test } from 'iperf'; | ||
|
||
const DataTestWrapper = (count: number): Test => { | ||
return async ({ container, perf }) => { | ||
const graph = new Graph({ | ||
container, | ||
data: { | ||
nodes: Array(count) | ||
.fill(0) | ||
.map((_, i) => ({ id: `${i}`, style: { x: 50, y: 50 } })), | ||
}, | ||
}); | ||
await perf.evaluate('data diff', async () => { | ||
// @ts-expect-error private method invoke | ||
await graph.prepare(); | ||
// @ts-expect-error context is private property | ||
const context = graph.context; | ||
// @ts-expect-error private method invoke | ||
context.element.computeChangesAndDrawData({}); | ||
}); | ||
}; | ||
}; | ||
|
||
export const dataDiff1000: Test = DataTestWrapper(1000); | ||
|
||
export const dataDiff5000: Test = DataTestWrapper(5000); | ||
|
||
export const dataDiff10000: Test = DataTestWrapper(10000); | ||
|
||
export const dataDiff50000: Test = DataTestWrapper(50000); | ||
|
||
export const dataDiff100000: Test = DataTestWrapper(100000); |
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,37 @@ | ||
import { Graph } from '@antv/g6'; | ||
import type { Test } from 'iperf'; | ||
|
||
const ElementTestWrapper = (count: number): Test => { | ||
return async ({ container, perf }) => { | ||
const graph = new Graph({ | ||
container, | ||
animation: false, // be sure to close the animation | ||
data: { | ||
nodes: Array(count) | ||
.fill(0) | ||
.map((_, i) => ({ id: `${i}`, style: { x: 50, y: 50 } })), | ||
}, | ||
layout: { | ||
type: 'grid', | ||
}, | ||
}); | ||
|
||
await perf.evaluate('element drawing', async () => { | ||
await graph.draw(); | ||
}); | ||
|
||
await perf.evaluate('grid layout', async () => { | ||
await graph.layout(); | ||
}); | ||
}; | ||
}; | ||
|
||
export const elementDrawing100: Test = ElementTestWrapper(100); | ||
|
||
export const elementDrawing500: Test = ElementTestWrapper(500); | ||
|
||
export const elementDrawing1000: Test = ElementTestWrapper(1000); | ||
|
||
export const elementDrawing5000: Test = ElementTestWrapper(5000); | ||
|
||
export const elementDrawing10000: Test = ElementTestWrapper(10000); |
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,15 @@ | ||
import { defineConfig } from 'iperf'; | ||
import path from 'path'; | ||
|
||
export default defineConfig({ | ||
perf: { | ||
report: { | ||
dir: './__tests__/perf-report', | ||
}, | ||
}, | ||
resolve: { | ||
alias: { | ||
'@antv/g6': path.resolve(__dirname, './src'), | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
后面可以单开一个 perf 目录单独存放。