Skip to content
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

🚀 filter #185

Merged
merged 2 commits into from
Dec 20, 2024
Merged

🚀 filter #185

merged 2 commits into from
Dec 20, 2024

Conversation

yujeong-jeon
Copy link
Contributor

@yujeong-jeon yujeong-jeon commented Dec 20, 2024

This resolves #83

@yujeong-jeon yujeong-jeon requested a review from a team as a code owner December 20, 2024 08:11
Copy link
Contributor

github-actions bot commented Dec 20, 2024

✅ All utility modules are properly registered

@yujeong-jeon yujeong-jeon self-assigned this Dec 20, 2024
@npayfebot
Copy link
Collaborator

npayfebot commented Dec 20, 2024

✅ Changeset detected

Latest commit: c74ccae

@naverpay/hidash package have detected changes.

If no version change is needed, please add skip-detect-change to the label.

The changes in this PR will be included in the next version bump.

powered by: naverpay changeset detect-add actions

Copy link
Contributor

github-actions bot commented Dec 20, 2024

Benchmark Results

Method Test Performance Comparison hidash ops/sec lodash@4.17.21 ops/sec
filter src/filter.bench.ts > filter performance hidash is 2.47x faster 16.88 🏆 6.83
findIndex src/findIndex.bench.ts > findIndex performance hidash is 5.52x faster 5800.52 🏆 1049.98
findLastIndex src/findLastIndex.bench.ts > findLastIndex performance hidash is 5.42x faster 5885.23 🏆 1085.41
map src/map.bench.ts > map performance hidash is 1.21x faster 451.97 🏆 372.72
some src/some.bench.ts > some performance hidash is 2.57x faster 18.61 🏆 7.23
uniqBy src/uniqBy.bench.ts > uniqBy performance hidash is 1.65x faster 62.26 🏆 37.71

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/filter.bench.ts",
      "groups": [
        {
          "fullName": "src/filter.bench.ts > filter performance",
          "benchmarks": [
            {
              "id": "-1531020664_0_0",
              "name": "hidash",
              "rank": 1,
              "rme": 0.5571998768014269,
              "samples": [],
              "totalTime": 592.5848279999999,
              "min": 58.98086999999987,
              "max": 60.549997000000076,
              "hz": 16.875221111803427,
              "period": 59.25848279999999,
              "mean": 59.25848279999999,
              "variance": 0.21307764014776182,
              "sd": 0.4616033363698337,
              "sem": 0.1459717918461515,
              "df": 9,
              "critical": 2.262,
              "moe": 0.3301881931559947,
              "p75": 59.19950800000015,
              "p99": 60.549997000000076,
              "p995": 60.549997000000076,
              "p999": 60.549997000000076,
              "sampleCount": 10,
              "median": 59.14633349999997
            },
            {
              "id": "-1531020664_0_1",
              "name": "lodash",
              "rank": 2,
              "rme": 14.717594101806043,
              "samples": [],
              "totalTime": 1464.8045860000002,
              "min": 117.79480899999999,
              "max": 214.2551080000003,
              "hz": 6.826849189015304,
              "period": 146.48045860000002,
              "mean": 146.48045860000002,
              "variance": 908.3387116564516,
              "sd": 30.138658093160874,
              "sem": 9.530680519545555,
              "df": 9,
              "critical": 2.262,
              "moe": 21.558399335212044,
              "p75": 169.06007899999986,
              "p99": 214.2551080000003,
              "p995": 214.2551080000003,
              "p999": 214.2551080000003,
              "sampleCount": 10,
              "median": 137.82016599999997
            }
          ]
        }
      ]
    },
    {
      "filepath": "/home/runner/work/hidash/hidash/src/findIndex.bench.ts",
      "groups": [
        {
          "fullName": "src/findIndex.bench.ts > findIndex performance",
          "benchmarks": [
            {
              "id": "-41870147_0_0",
              "name": "hidash",
              "rank": 1,
              "rme": 0.3511398084666202,
              "samples": [],
              "totalTime": 500.12769000000304,
              "min": 0.16282300000000305,
              "max": 0.3679459999999608,
              "hz": 5800.518663543669,
              "period": 0.17239837642192452,
              "mean": 0.17239837642192452,
              "variance": 0.0002767337096527195,
              "sd": 0.016635315135359457,
              "sem": 0.00030885680039158606,
              "df": 2900,
              "critical": 1.96,
              "moe": 0.0006053593287675086,
              "p75": 0.17220099999997274,
              "p99": 0.2399670000000924,
              "p995": 0.26241899999996576,
              "p999": 0.3488609999999426,
              "sampleCount": 2901,
              "median": 0.16781200000002627
            },
            {
              "id": "-41870147_0_1",
              "name": "lodash",
              "rank": 2,
              "rme": 0.39900545507890395,
              "samples": [],
              "totalTime": 500.0114659999995,
              "min": 0.9026329999999234,
              "max": 1.602688000000171,
              "hz": 1049.9759219521588,
              "period": 0.9524027923809514,
              "mean": 0.9524027923809514,
              "variance": 0.0019735409732646566,
              "sd": 0.04442455372048949,
              "sem": 0.0019388464775121448,
              "df": 524,
              "critical": 1.96,
              "moe": 0.0038001390959238037,
              "p75": 0.9537980000000061,
              "p99": 1.075706000000082,
              "p995": 1.156906000000049,
              "p999": 1.602688000000171,
              "sampleCount": 525,
              "median": 0.9457529999999679
            }
          ]
        }
      ]
    },
    {
      "filepath": "/home/runner/work/hidash/hidash/src/findLastIndex.bench.ts",
      "groups": [
        {
          "fullName": "src/findLastIndex.bench.ts > findLastIndex performance",
          "benchmarks": [
            {
              "id": "-1898411277_0_0",
              "name": "hidash",
              "rank": 1,
              "rme": 0.4446482628633893,
              "samples": [],
              "totalTime": 500.065509000001,
              "min": 0.1596079999999347,
              "max": 0.5967620000000124,
              "hz": 5885.228929076159,
              "period": 0.16991692456676893,
              "mean": 0.16991692456676893,
              "variance": 0.00043730515524718466,
              "sd": 0.02091184246419202,
              "sem": 0.0003854758435699151,
              "df": 2942,
              "critical": 1.96,
              "moe": 0.0007555326533970336,
              "p75": 0.1684439999999654,
              "p99": 0.2423109999999724,
              "p995": 0.35205599999994774,
              "p999": 0.3797179999999116,
              "sampleCount": 2943,
              "median": 0.1654779999999505
            },
            {
              "id": "-1898411277_0_1",
              "name": "lodash",
              "rank": 2,
              "rme": 0.23983889003114622,
              "samples": [],
              "totalTime": 500.271623000002,
              "min": 0.8938060000000405,
              "max": 1.1489919999999074,
              "hz": 1085.4103551661929,
              "period": 0.9213105395948472,
              "mean": 0.9213105395948472,
              "variance": 0.0006901428245108681,
              "sd": 0.0262705695505611,
              "sem": 0.0011273780468899213,
              "df": 542,
              "critical": 1.96,
              "moe": 0.0022096609719042455,
              "p75": 0.9205560000000332,
              "p99": 1.0587940000000344,
              "p995": 1.0702049999999872,
              "p999": 1.1489919999999074,
              "sampleCount": 543,
              "median": 0.9144450000001143
            }
          ]
        }
      ]
    },
    {
      "filepath": "/home/runner/work/hidash/hidash/src/map.bench.ts",
      "groups": [
        {
          "fullName": "src/map.bench.ts > map performance",
          "benchmarks": [
            {
              "id": "354973082_0_0",
              "name": "hidash",
              "rank": 1,
              "rme": 0.2220085745556156,
              "samples": [],
              "totalTime": 500.0279459999992,
              "min": 2.160267000000033,
              "max": 2.3397939999999835,
              "hz": 451.9747382279317,
              "period": 2.2125130353982265,
              "mean": 2.2125130353982265,
              "variance": 0.001419408721385232,
              "sd": 0.03767504109334497,
              "sem": 0.0025061064549718294,
              "df": 225,
              "critical": 1.96,
              "moe": 0.004911968651744786,
              "p75": 2.2414380000000165,
              "p99": 2.3295629999999505,
              "p995": 2.333790000000022,
              "p999": 2.3397939999999835,
              "sampleCount": 226,
              "median": 2.1927880000000073
            },
            {
              "id": "354973082_0_1",
              "name": "lodash",
              "rank": 2,
              "rme": 0.2297770818110942,
              "samples": [],
              "totalTime": 501.713086000002,
              "min": 2.6292520000001787,
              "max": 2.898594000000003,
              "hz": 372.7229869383938,
              "period": 2.682957679144396,
              "mean": 2.682957679144396,
              "variance": 0.001849994883616523,
              "sd": 0.0430115668584222,
              "sem": 0.0031453172762064556,
              "df": 186,
              "critical": 1.96,
              "moe": 0.006164821861364653,
              "p75": 2.7121660000000247,
              "p99": 2.8498930000000655,
              "p995": 2.898594000000003,
              "p999": 2.898594000000003,
              "sampleCount": 187,
              "median": 2.6713300000000118
            }
          ]
        }
      ]
    },
    {
      "filepath": "/home/runner/work/hidash/hidash/src/some.bench.ts",
      "groups": [
        {
          "fullName": "src/some.bench.ts > some performance",
          "benchmarks": [
            {
              "id": "817802700_0_0",
              "name": "hidash",
              "rank": 1,
              "rme": 0.3728227930857624,
              "samples": [],
              "totalTime": 537.4112059999998,
              "min": 53.520888000000014,
              "max": 54.45577099999991,
              "hz": 18.60772512436223,
              "period": 53.741120599999974,
              "mean": 53.741120599999974,
              "variance": 0.07845726169158479,
              "sd": 0.28010223435664483,
              "sem": 0.08857610382692659,
              "df": 9,
              "critical": 2.262,
              "moe": 0.20035914685650794,
              "p75": 53.85232999999994,
              "p99": 54.45577099999991,
              "p995": 54.45577099999991,
              "p999": 54.45577099999991,
              "sampleCount": 10,
              "median": 53.62917999999996
            },
            {
              "id": "817802700_0_1",
              "name": "lodash",
              "rank": 2,
              "rme": 20.169697706952196,
              "samples": [],
              "totalTime": 1383.5991960000001,
              "min": 109.79932300000019,
              "max": 214.29752899999994,
              "hz": 7.227526605183138,
              "period": 138.3599196,
              "mean": 138.3599196,
              "variance": 1522.0684342300583,
              "sd": 39.013695470053314,
              "sem": 12.337213762556189,
              "df": 9,
              "critical": 2.262,
              "moe": 27.9067775309021,
              "p75": 164.84030299999995,
              "p99": 214.29752899999994,
              "p995": 214.29752899999994,
              "p999": 214.29752899999994,
              "sampleCount": 10,
              "median": 114.03048650000028
            }
          ]
        }
      ]
    },
    {
      "filepath": "/home/runner/work/hidash/hidash/src/uniqBy.bench.ts",
      "groups": [
        {
          "fullName": "src/uniqBy.bench.ts > uniqBy performance",
          "benchmarks": [
            {
              "id": "-1039251384_0_0",
              "name": "hidash",
              "rank": 1,
              "rme": 0.18302133961292275,
              "samples": [],
              "totalTime": 513.9962960000005,
              "min": 15.92825300000004,
              "max": 16.31227899999999,
              "hz": 62.25725797837261,
              "period": 16.062384250000015,
              "mean": 16.062384250000015,
              "variance": 0.006645929104322145,
              "sd": 0.08152256806751211,
              "sem": 0.014411290175069928,
              "df": 31,
              "critical": 2.0399,
              "moe": 0.029397590828125143,
              "p75": 16.092570000000023,
              "p99": 16.31227899999999,
              "p995": 16.31227899999999,
              "p999": 16.31227899999999,
              "sampleCount": 32,
              "median": 16.043052499999988
            },
            {
              "id": "-1039251384_0_1",
              "name": "lodash",
              "rank": 2,
              "rme": 0.16499866939944843,
              "samples": [],
              "totalTime": 503.87227099999996,
              "min": 26.319786000000022,
              "max": 26.73421899999994,
              "hz": 37.7079690499579,
              "period": 26.519593210526313,
              "mean": 26.519593210526313,
              "variance": 0.008241307068731404,
              "sd": 0.09078164499903824,
              "sem": 0.020826737709431168,
              "df": 18,
              "critical": 2.101,
              "moe": 0.04375697592751488,
              "p75": 26.56515300000001,
              "p99": 26.73421899999994,
              "p995": 26.73421899999994,
              "p999": 26.73421899999994,
              "sampleCount": 19,
              "median": 26.53100900000004
            }
          ]
        }
      ]
    }
  ]
}

Last updated by GitHub Actions

Copy link
Member

@2-one-week 2-one-week left a comment

Choose a reason for hiding this comment

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

LGTM

@yujeong-jeon yujeong-jeon merged commit 59036f7 into main Dec 20, 2024
6 checks passed
@yujeong-jeon yujeong-jeon deleted the feature/83 branch December 20, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

filter
3 participants