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

Performance: 'Minimal' layout mode #369

Merged
merged 13 commits into from
Feb 26, 2019

Conversation

bryphe
Copy link
Member

@bryphe bryphe commented Feb 25, 2019

This is a change to add an alternate layout mode - a streamlined layout when portions of the tree just need to be positioned absolutely relative to the direct parent or via transforms. This saves expensive layout calculations.

This adds a style layoutMode with the settings of Default or Minimal. This is an advanced-use-case setting (ie, trying to squeeze extra perf out of the layout system in constrained cases), but shouldn't be something you need day-to-day. In Onivim2, I'm experimenting with rendering the lines in the minimap with this strategy (although longer term - would like to render directly to a pixel buffer!)

This also adds an initial set of benchmarks via 'reperf'`, and highlights the difference between the standard layout and the 'minimal' layout strategy:

+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|  BENCHMARK                                                   |  TIME             |  MINOR GC  |  MAJOR GC  |  MINOR ALLOC  |  PROMOTED   |  MAJOR ALLOC  |
|--------------------------------------------------------------+-------------------+------------+------------+---------------+-------------+---------------|
|  Node: create single node                                    |  0.0019953250885  |  5         |  0         |  1090240      |  374        |  374          |
|--------------------------------------------------------------+-------------------+------------+------------+---------------+-------------+---------------|
|  Layout: layout single node                                  |  0.079295873642   |  5         |  0         |  1260481      |  421        |  421          |
|--------------------------------------------------------------+-------------------+------------+------------+---------------+-------------+---------------|
|  Layout: layout node tree (4 deep, 4 wide)                   |  3.63596487045    |  2327      |  865       |  458726216    |  125113447  |  125113447    |
|--------------------------------------------------------------+-------------------+------------+------------+---------------+-------------+---------------|
|  Layout: layout node tree (4 deep, 4 wide) - minimal layout  |  0.187062501907   |  53        |  0         |  13742150     |  2482       |  2482         |
+----------------------------------------------------------------------------------------------------------------------------------------------------------+

This should help lower the layout cost when re-rendering Onivim 2, although more work is still needed (in my current benchmarks - lowered the cost ~50%). We should still explore generally improving the layout nodes - regenerating the layout tree is very costly!

@bryphe bryphe changed the title [WIP] Performance: 'Minimal' layout mode Performance: 'Minimal' layout mode Feb 26, 2019
@bryphe bryphe merged commit fcbc95b into master Feb 26, 2019
@bryphe bryphe deleted the bryphe/performance/minimal-layout-mode branch February 26, 2019 01:11
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.

1 participant