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 13, 2022
1 parent 1930124 commit fec7c1a
Show file tree
Hide file tree
Showing 4 changed files with 282 additions and 280 deletions.
8 changes: 0 additions & 8 deletions build/browserstack-quick.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
"ie_9",
"safari_9.1",
"safari_current",
{

"browser": "opera",
"browser_version": "36.0",
"device": null,
"os": "OS X",
"os_version": "Sierra"
},
"opera_current",
"chrome_current",
{
Expand Down
1 change: 1 addition & 0 deletions src/core/utilities.js
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit fec7c1a

Please sign in to comment.