GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — perf: faster helpers, hot hooks, resolvers and cache keys by fratzinger · Pull Request #81 · feathersjs/feathers-utils Conversation
Member
Performance pass over code that runs per service call or per result item. Every change was benchmarked against ResultsNode 24, microbenchmarks, ns per call:
Changeshelpers (
hooks and resolvers (
cache (
Behavior changes
Not changed
Verification
🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions- pickPaths: a string without `.` or `[` is read as one key without `castPath`, and a nested path is resolved in one walk instead of three (~2.2x faster for flat keys) - omitPaths: top-level keys are skipped while copying instead of deleted afterwards, which kept the result out of V8's dictionary mode (~2.3x faster for flat keys) - isEqual: objects with the same keys in the same order skip the per-key `propertyIsEnumerable` lookup in `b` (~20% faster) Adds edge-case tests that pin the previous behavior (inherited keys, unsafe keys, literal dotted keys, symbol/numeric/empty keys, non-enumerable keys). Co-Authored-By: Claude Opus 5.5 <[email protected]> - resolvers: build the property list in place instead of concat/Set/spread, skip the status spreads on the top level (~1.7x per item) - setData/setResult: read `from` via the new internal `getContextPath` instead of building `context.toJSON()` on every call (~5x per call) - checkRequired: walk each path once, the second walk only runs to word the error - iff/iffElse: combine the hooks once at creation instead of per call - checkContext: match inline instead of copying the options and building an `isContext` closure per call (~3x) - disallow: build the `isProvider` predicate once - throwIf, transformData, transformResult, muteEvent, resolve: only `await` a pending promise; public return types stay `Promise<void>` Co-Authored-By: Claude Opus 5.5 <[email protected]> - cache: a miss is stored under the key it was looked up with. Before, `set` serialized the params again, so a hook after `cache` that changed the params moved the entry to a key no identical call would look up - and every miss paid for the key twice. - stringifyParams: `normalize` now tracks whether `JSON.stringify` prints the normalized params exactly like `safe-stable-stringify` (no cycle, BigInt, class instance, `toJSON` key, encoded symbol or integer-like key) and uses the native one then (~1.4-1.5x). Keys are unchanged: fuzzed against the previous implementation with 200k random params. - normalize: sort primitive `$in`/`$nin` elements without `safeStringify`, track cycles with an array instead of a `WeakSet`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |