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

Speedup table building #276

Merged
merged 41 commits into from
Jun 25, 2020
Merged

Speedup table building #276

merged 41 commits into from
Jun 25, 2020

Conversation

Jym77
Copy link
Contributor

@Jym77 Jym77 commented Jun 24, 2020

This should significantly speed up table building by registering which row/column contains data cell and thus avoid going through all cells when computing scope.

More speedup can be achieved on the internal headers scanning. Looking into it.

Also improving code for update function with cleaner default parameters initialisation.

@Jym77 Jym77 self-assigned this Jun 24, 2020
@Jym77 Jym77 added the internal Change that only affects internal APIs or other non-public aspects label Jun 24, 2020
/**
* Update cells/downward growing cells, and resync slots with all (updated) cells
*/
public updateCells({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

updateCells, addCells and _updateSlots are duplicated in row, row group and table.
Given that they are fairly complex (and I did fix a bunch of bugs in it), I'd really like to refactor this, but I'm not sure about the best way to do… parent abstract class? other?

@Jym77
Copy link
Contributor Author

Jym77 commented Jun 25, 2020

Also optimizing the table model errors checks.
Instead of going through all cells and figuring out if another cell is covering the same slot (quadratic in the number of cells), we now just go through all slots and count coverage (linear in the number of cells, but with twice as much storage used).

@Jym77 Jym77 marked this pull request as ready for review June 25, 2020 09:42
@Jym77 Jym77 requested a review from kasperisager as a code owner June 25, 2020 09:42
Copy link
Contributor

@kasperisager kasperisager left a comment

Choose a reason for hiding this comment

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

Looks great and definitely seems to help on the performance 👌

@Jym77 Jym77 merged commit 8ac0c05 into master Jun 25, 2020
@Jym77 Jym77 deleted the speedup-table-building branch June 25, 2020 12:20
kasperisager added a commit that referenced this pull request Jul 1, 2020
* master: (21 commits)
  Rework the way DOM parent pointers are handled (#283)
  Create a GitHub release as part of release workflow
  Backtrack on shortcut links
  v0.3.0
  Prepare release
  Update changelog
  Update changelog
  `RoleOptions#allowPresentational` must be optional
  Update SIA R67 (#272)
  Update lockfile
  Correctly resolve important and overridden CSS properties (#282)
  Introduce HyperScript-like DSL for constructing DOM (#281)
  Use dynamic import rather than `require()` for loading formatters (#278)
  Add `Future#get()` and accept thunked promises in `Future.from()` (#279)
  Fix default argument type parameter of several types
  Speedup table building (#276)
  Add initial support for `background` shorthand property (#277)
  Output stack in CLI errors if available
  Chesterton's fence strikes again!
  Correctly pull `.message` from expectations
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Change that only affects internal APIs or other non-public aspects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants