-
Notifications
You must be signed in to change notification settings - Fork 1
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
🚀 find #153
🚀 find #153
Conversation
9ebeaad
to
1eec534
Compare
✅ All utility modules are properly registered |
✅ Changeset detectedLatest commit: 9983a95
If no version change is needed, please add The changes in this PR will be included in the next version bump. powered by: naverpay changeset detect-add actions |
Benchmark Results
View Full Benchmark Data{
"files": [
{
"filepath": "/home/runner/work/hidash/hidash/src/find.bench.ts",
"groups": [
{
"fullName": "src/find.bench.ts > find performance",
"benchmarks": [
{
"id": "-2037859673_0_0",
"name": "hidash",
"rank": 1,
"rme": 2.477793741108984,
"samples": [],
"totalTime": 500.1922619999998,
"min": 0.5371119999999792,
"max": 1.422384999999963,
"hz": 1547.4049856453003,
"period": 0.6462432325581393,
"mean": 0.6462432325581393,
"variance": 0.051659611709686803,
"sd": 0.22728750891698118,
"sem": 0.008169680800339772,
"df": 773,
"critical": 1.96,
"moe": 0.016012574368665954,
"p75": 0.6007720000000063,
"p99": 1.3861080000000356,
"p995": 1.4023689999999647,
"p999": 1.422384999999963,
"sampleCount": 774,
"median": 0.5528104999999641
},
{
"id": "-2037859673_0_1",
"name": "lodash",
"rank": 2,
"rme": 1.9315795605281465,
"samples": [],
"totalTime": 501.2380760000026,
"min": 2.4452880000001187,
"max": 4.033638999999994,
"hz": 373.07620660486106,
"period": 2.6804175187165913,
"mean": 2.6804175187165913,
"variance": 0.13048469105423569,
"sd": 0.36122664776319546,
"sem": 0.02641550863691091,
"df": 186,
"critical": 1.96,
"moe": 0.05177439692834538,
"p75": 2.677381000000196,
"p99": 4.007618999999977,
"p995": 4.033638999999994,
"p999": 4.033638999999994,
"sampleCount": 187,
"median": 2.5369779999998627
}
]
}
]
}
]
} Last updated by GitHub Actions |
return isPartialMatch(item, predicate as DeepPartial<T>) | ||
} | ||
|
||
export function find<T>(collection: T[] | Record<string, T>, predicate?: Predicate<T> | Shorthand<T>): T | undefined { |
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.
https://deno.land/x/lodash@4.17.13-amd/_createFind.js?source
구현상 baseIteratee타입이 적용되어야 하는것 같아서 predicate: predicate?: ListIterateeCustom<T, unknown>
아닐까요 혹시~?
const iteratee = baseIteratee(predicate)
혹시 추가 성능 개선 필요하다면 baseIteratee 쪽에 통일되는 편이 앞으로 collection 처리할 때 유용할거 같습니다 :)
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.
네네 최초에 그렇게 했는데... 초큼 많이 느려가지고 잠깐 손좀 보고 말씀드리겠습니다!
} | ||
|
||
export function find<T>(collection: T[] | Record<string, T>, predicate?: Predicate<T> | Shorthand<T>): T | undefined { | ||
const array = isArray(collection) ? collection : Object.values(collection) |
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.
요거 보니까 collection이 꼭 T[]일 필요 없을거 같습니다~
This resolves #63