Skip to content
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

Weird performance issue #19639

Closed
wants to merge 1 commit into from
Closed

Weird performance issue #19639

wants to merge 1 commit into from

Conversation

ellatrix
Copy link
Member

Description

This is just to share and not to actually merge. It's super strange that removing this causes typing speed too increase from 30ms to 36ms (20%!).

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

@ellatrix
Copy link
Member Author


Switched to branch 'try/weird-performance'
Ellas-MacBook-Pro:gutenberg ella$ npm run test-performance

> gutenberg@7.2.0 test-performance /Users/ella/gutenberg
> wp-scripts test-e2e --config packages/e2e-tests/jest.performance.config.js

 PASS  packages/e2e-tests/specs/performance/performance.test.js (21.502s)
  Performance
    ✓ 1000 paragraphs (18661ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        21.617s, estimated 23s
Ran all test suites.

Average time to load: 4653ms
Average time to DOM content load: 4331ms
Average time to type character: 37.7ms
Slowest time to type character: 113ms
Fastest time to type character: 18ms
		
Ellas-MacBook-Pro:gutenberg ella$ git checkout master
M	packages/e2e-tests/config/setup-test-framework.js
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
Ellas-MacBook-Pro:gutenberg ella$ npm run test-performance

> gutenberg@7.2.0 test-performance /Users/ella/gutenberg
> wp-scripts test-e2e --config packages/e2e-tests/jest.performance.config.js

 PASS  packages/e2e-tests/specs/performance/performance.test.js (20.715s)
  Performance
    ✓ 1000 paragraphs (18106ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        20.819s, estimated 22s
Ran all test suites.

Average time to load: 4646ms
Average time to DOM content load: 4608ms
Average time to type character: 32.19ms
Slowest time to type character: 75ms
Fastest time to type character: 20ms
		
Ellas-MacBook-Pro:gutenberg ella$ git checkout -
M	packages/e2e-tests/config/setup-test-framework.js
Switched to branch 'try/weird-performance'
Ellas-MacBook-Pro:gutenberg ella$ npm run test-performance

> gutenberg@7.2.0 test-performance /Users/ella/gutenberg
> wp-scripts test-e2e --config packages/e2e-tests/jest.performance.config.js

 PASS  packages/e2e-tests/specs/performance/performance.test.js (21.519s)
  Performance
    ✓ 1000 paragraphs (18783ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        21.622s
Ran all test suites.

Average time to load: 4433ms
Average time to DOM content load: 4392ms
Average time to type character: 38.27ms
Slowest time to type character: 101ms
Fastest time to type character: 28ms
		
Ellas-MacBook-Pro:gutenberg ella$ git checkout master
M	packages/e2e-tests/config/setup-test-framework.js
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
Ellas-MacBook-Pro:gutenberg ella$ npm run test-performance

> gutenberg@7.2.0 test-performance /Users/ella/gutenberg
> wp-scripts test-e2e --config packages/e2e-tests/jest.performance.config.js

 PASS  packages/e2e-tests/specs/performance/performance.test.js (20.565s)
  Performance
    ✓ 1000 paragraphs (18255ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        20.66s, estimated 22s
Ran all test suites.

Average time to load: 4661ms
Average time to DOM content load: 4618ms
Average time to type character: 33.155ms
Slowest time to type character: 127ms
Fastest time to type character: 19ms
		
Ellas-MacBook-Pro:gutenberg ella$ 

@@ -87,7 +59,6 @@ function BlockListBlock( {
isSelectionEnabled,
className,
name,
index,
Copy link
Contributor

Choose a reason for hiding this comment

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

you can also remove the selector from withSelect

Copy link
Member Author

Choose a reason for hiding this comment

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

It's part of #19597. This branch is just to illustrate the performance issue. :)

function BlockListBlock( {
mode,
isFocusMode,
moverDirection,
Copy link
Contributor

Choose a reason for hiding this comment

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

you can also remove the prop from BlockList

@ellatrix ellatrix closed this Jan 15, 2020
@ellatrix ellatrix deleted the try/weird-performance branch January 15, 2020 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants