Skip to content

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

Merged
merged 2 commits into from
May 14, 2025

Conversation

umsungjun
Copy link
Contributor

  • Added isMap.test.ts for verifying functionality
  • Added isMap.bench.ts for performance comparison with lodash

스크린샷 2025-05-13 오후 8 44 22
스크린샷 2025-05-13 오후 8 44 42

- Added isMap.test.ts for verifying functionality
- Added isMap.bench.ts for performance comparison with lodash
@umsungjun umsungjun requested a review from a team as a code owner May 13, 2025 11:45
Copy link
Contributor

github-actions bot commented May 13, 2025

✅ All utility modules are properly registered in index.ts and package.json exports!

Copy link
Contributor

github-actions bot commented May 13, 2025

Benchmark Results

Method Test Performance Comparison hidash ops/sec lodash@4.17.21 ops/sec
isMap src/isMap.bench.ts > isMap performance hidash is 3.03x faster 2437.13 🏆 803.12

Note: Higher operations per second (ops/sec) numbers are better. Each test compares hidash vs lodash implementation.

⚠️ indicates where hidash is slower than lodash.

🏆 indicates the faster implementation.

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


const testCases = [new Map(), {}, [], new Set(), null, undefined, 21, 'string', false, Symbol('symbol')]

const ITERATIONS = 10000
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스크린샷 2025-05-13 오후 9 59 08

Copy link
Contributor

@yujeong-jeon yujeong-jeon left a 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 👍👍

@yceffort-naver yceffort-naver merged commit 940a231 into NaverPayDev:main May 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants