Skip to content

Commit

Permalink
Core: Improve performance of QUnit.equiv()
Browse files Browse the repository at this point in the history
Small refactors (removals/adjustments) to make code more readable.
Makes code more readable and remove variable mutations.

* Remove IIFE closure, moving main function as direct export,
  and the rest as top-level local function.

* callbacks.object: Optimize compareConstructors().

* callbacks.object: Optimize object comparison prop call by skipping
  overhead and indirection of typeEquiv() for known array type.

* callbacks.array: Optimize isContainer() away, using a predefined Set.

* innerEquiv: Remove array allocation by re-using `slice` reference.

Closes #1700.
  • Loading branch information
izelnakri authored and Krinkle committed Sep 11, 2022
1 parent 9db724f commit 337ccb7
Show file tree
Hide file tree
Showing 3 changed files with 278 additions and 272 deletions.
1 change: 1 addition & 0 deletions src/core/utilities.js
Expand Up @@ -3,6 +3,7 @@ import Logger from '../logger';

export const toString = Object.prototype.toString;
export const hasOwn = Object.prototype.hasOwnProperty;
export const slice = Array.prototype.slice;

const nativePerf = getNativePerf();

Expand Down

0 comments on commit 337ccb7

Please sign in to comment.