Skip to content

Conversation

yceffort-naver
Copy link
Contributor

@yceffort-naver yceffort-naver commented May 26, 2025

No description provided.

@yceffort-naver yceffort-naver self-assigned this May 26, 2025
@yceffort-naver yceffort-naver requested a review from a team as a code owner May 26, 2025 04:05
Copy link
Contributor

github-actions bot commented May 26, 2025

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

Copy link
Contributor

github-actions bot commented May 26, 2025

Benchmark Results

Method Test Performance Comparison hidash ops/sec [email protected] ops/sec
difference src/difference.bench.ts > difference performance hidash is 3.13x faster 287.64 🏆 91.96

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/difference.bench.ts",
      "groups": [
        {
          "fullName": "src/difference.bench.ts > difference performance",
          "benchmarks": [
            {
              "id": "173394915_0_0",
              "name": "hidash",
              "rank": 1,
              "rme": 0.8516265325051949,
              "samples": [],
              "totalTime": 500.6241629999993,
              "min": 3.2616140000000087,
              "max": 4.819305999999983,
              "hz": 287.6409303479828,
              "period": 3.476556687499995,
              "mean": 3.476556687499995,
              "variance": 0.032858470711223685,
              "sd": 0.18126905613265515,
              "sem": 0.015105754677721262,
              "df": 143,
              "critical": 1.96,
              "moe": 0.029607279168333674,
              "p75": 3.497673999999961,
              "p99": 4.630835000000047,
              "p995": 4.819305999999983,
              "p999": 4.819305999999983,
              "sampleCount": 144,
              "median": 3.4673324999999693
            },
            {
              "id": "173394915_0_1",
              "name": "lodash",
              "rank": 2,
              "rme": 0.5941335307761362,
              "samples": [],
              "totalTime": 500.2116189999999,
              "min": 10.723551999999927,
              "max": 12.150990999999976,
              "hz": 91.96107857702523,
              "period": 10.874165630434781,
              "mean": 10.874165630434781,
              "variance": 0.04728982907698834,
              "sd": 0.21746224747525336,
              "sem": 0.032063059157591695,
              "df": 45,
              "critical": 2.015,
              "moe": 0.06460706420254726,
              "p75": 10.92500700000005,
              "p99": 12.150990999999976,
              "p995": 12.150990999999976,
              "p999": 12.150990999999976,
              "sampleCount": 46,
              "median": 10.82320750000008
            }
          ]
        }
      ]
    }
  ]
}

Last updated by GitHub Actions

Copy link
Contributor

@AndrewSRP AndrewSRP left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

Comment on lines +24 to 27
* @returns {{debounce: Function, cancel: Function, flush: Function}} An object containing the debounced function, a cancel function, and a flush function.
*/
export function debounce<Args extends unknown[]>(
func: (...args: Args) => unknown,
Copy link
Contributor

@yujeong-jeon yujeong-jeon Jun 9, 2025

Choose a reason for hiding this comment

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

This is not related to the changes in this PR, but I have a question regarding the debounce implementation, especially about the return type of func.

Currently, the func argument is typed to return unknown. Is this considered type-safe in TypeScript?
For example, if I pass an async function that returns a Promise<boolean> to debounce, the resulting debounced function’s return type becomes unknown, which requires type assertions or runtime checks when using the return value.
Would it be possible or preferable to type the debounced function so that it preserves the original return type of func, instead of returning unknown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yujeong-jeon thanks for your comment.

I think it would be better to improve this using generics instead of unknown. I'll handle this in a separate issue.
thanks.

@yceffort-naver yceffort-naver merged commit 6bd42d7 into main Jun 9, 2025
6 checks passed
@yceffort-naver yceffort-naver deleted the chore/docs_2 branch June 9, 2025 06:14
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