-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add unit tests and benchmark for isMap #265
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
feat: add unit tests and benchmark for isMap #265
Conversation
umsungjun
commented
May 13, 2025
- Added isMap.test.ts for verifying functionality
- Added isMap.bench.ts for performance comparison with lodash
- Added isMap.test.ts for verifying functionality - Added isMap.bench.ts for performance comparison with lodash
✅ All utility modules are properly registered in |
Benchmark Results
View Full Benchmark Data{
"files": [
{
"filepath": "/home/runner/work/hidash/hidash/src/isMap.bench.ts",
"groups": [
{
"fullName": "src/isMap.bench.ts > isMap performance",
"benchmarks": [
{
"id": "1620508964_0_0",
"name": "hidash",
"rank": 1,
"rme": 1.1493624260168982,
"samples": [],
"totalTime": 500.17797800000045,
"min": 0.36975100000000793,
"max": 1.035052999999948,
"hz": 2437.132488068075,
"period": 0.4103182756357674,
"mean": 0.4103182756357674,
"variance": 0.007057441317198361,
"sd": 0.08400857883096441,
"sem": 0.002406144942468347,
"df": 1218,
"critical": 1.96,
"moe": 0.00471604408723796,
"p75": 0.3979030000000421,
"p99": 0.8317130000000361,
"p995": 0.841731999999979,
"p999": 0.9500239999999849,
"sampleCount": 1219,
"median": 0.3875439999999344
},
{
"id": "1620508964_0_1",
"name": "lodash",
"rank": 2,
"rme": 0.4818856832559741,
"samples": [],
"totalTime": 500.546839,
"min": 1.2026070000000573,
"max": 2.129287999999974,
"hz": 803.1216435271505,
"period": 1.2451413905472637,
"mean": 1.2451413905472637,
"variance": 0.0037673788712057122,
"sd": 0.061378977436950775,
"sem": 0.003061305151704907,
"df": 401,
"critical": 1.96,
"moe": 0.006000158097341618,
"p75": 1.2428820000000087,
"p99": 1.510093999999981,
"p995": 1.5535919999999805,
"p999": 2.129287999999974,
"sampleCount": 402,
"median": 1.2351180000000568
}
]
}
]
}
]
} Last updated by GitHub Actions |
src/isMap.bench.ts
Outdated
|
||
const testCases = [new Map(), {}, [], new Set(), null, undefined, 21, 'string', false, Symbol('symbol')] | ||
|
||
const ITERATIONS = 10000 |
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.
The number of iterations is all 1000 :) It is easier to test with the size of the test dataset than with a large number of iterations.
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.
Thank you for the feedback!
I’ve updated the number of iterations from 10,000 to 1,000 as you suggested, to align with the existing convention.
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.
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.
Thank you for contributing to the generation of test codes 👍👍