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

Improve efficiency of the dependency graph (56% speed-up) #1293

Merged
merged 33 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
69878c7
Refactor src/DateTimeDefault
sequba Jul 26, 2023
d38f047
Tmp changes to package.json
sequba Jul 26, 2023
cfbc55a
Reduce the number of calls to adjacentNodes()
sequba Jul 26, 2023
4952638
Move topological sorting algorithm to separate class
sequba Jul 27, 2023
f0f591c
Partition topsort function into smaller parts
sequba Jul 27, 2023
7e9737b
Rewrite topological sorting to use ids and simple arrays instead of M…
sequba Aug 1, 2023
ca5cb70
Add a date/time parsing quick check to escape early if the string doe…
sequba Aug 14, 2023
a1b8ffa
Memoize parsing result of date and time formats for better performance
sequba Aug 14, 2023
48a1d42
Improve documentation of the date/time parsing functions in DateTimeD…
sequba Aug 14, 2023
6f7625f
Fix regexp escape character
sequba Aug 14, 2023
62d876a
Remove unused method in Graph class
sequba Aug 16, 2023
e6cc8ca
Make Graph.nodes private
sequba Aug 16, 2023
0bc660d
Fix removeEdge issue
sequba Aug 25, 2023
ed2aad8
Merge branch 'develop' of github.com:handsontable/hyperformula into f…
sequba Aug 29, 2023
39e770a
Add changelog entry
sequba Aug 29, 2023
fd9f3c0
Remove unnecessary comments
sequba Aug 29, 2023
ea1f448
Remove graph.nodesCount() function (YAGNI)
sequba Aug 29, 2023
294aaf4
Remove graph.edgesCount() function (YAGNI)
sequba Aug 29, 2023
f42c368
Remove graph.getDependencies() function (YAGNI)
sequba Aug 29, 2023
30bdcb2
Add typedocs to all methods of Graph.ts
sequba Aug 29, 2023
0db23ea
Refactor tests for Graph class
sequba Aug 29, 2023
0fd2c24
Improve code coverage for the Graph class
sequba Aug 29, 2023
1a99297
Improve code formatting in Graph.ts and TopSort.ts
sequba Aug 29, 2023
e76fa43
Convert recently changed nodes set to map in Graph class
sequba Aug 30, 2023
3019ac6
Convert volatile nodes set to array of numbers in Graph class
sequba Aug 30, 2023
c234ef0
Convert all sets of nodes to arrays of numbers in Graph class
sequba Aug 30, 2023
c7e3bdb
Improve documentation for Graph class
sequba Aug 30, 2023
004ac3d
Introduce ProcessableValue class for better performance
sequba Sep 5, 2023
ce5e10f
Try a few more optimizations
sequba Sep 6, 2023
c135a48
Change graph.infiniteRangeIds to be a Set of numbers (ids)
sequba Sep 6, 2023
65d4505
Adjust test descriptions
sequba Sep 6, 2023
e3bc190
Fix browser tests
sequba Sep 6, 2023
69095fc
Merge branch 'develop' into feature/issue-876
sequba Sep 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/test-jest/
node_modules/
/typings/
/storage/

*.iml
dev*.html
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to
### Changed

- Improve efficiency of the default date/time parsing methods. [#876](https://github.com/handsontable/hyperformula/issues/876)
- Improve efficiency of the operations on the dependency graph. [#876](https://github.com/handsontable/hyperformula/issues/876)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion src/BuildEngineFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class BuildEngineFactory {
throw new SheetSizeLimitExceededError()
}
const sheetId = sheetMapping.addSheet(sheetName)
addressMapping.autoAddSheet(sheetId, sheet, boundaries)
addressMapping.autoAddSheet(sheetId, boundaries)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/DateTimeDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ function defaultParseToTime(timeItems: string[], timeFormat: Maybe<string>): May
}

const hours = ampm !== undefined
? hoursParsed % 12 + (ampm ? 12 : 0)
: hoursParsed
? hoursParsed % 12 + (ampm ? 12 : 0)
: hoursParsed

return { hours, minutes, seconds }
}
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyGraph/AddressMapping/AddressMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class AddressMapping {
this.mapping.set(sheetId, strategy)
}

public autoAddSheet(sheetId: number, sheet: Sheet, sheetBoundaries: SheetBoundaries) {
public autoAddSheet(sheetId: number, sheetBoundaries: SheetBoundaries) {
const {height, width, fill} = sheetBoundaries
const strategyConstructor = this.policy.call(fill)
this.addSheet(sheetId, new strategyConstructor(width, height))
Expand Down
Loading
Loading