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

Upstream from RelationalAI: Salsa performance improvements: Remove allocations #27

Merged
merged 22 commits into from
Jul 13, 2020
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9c2d553
Use Base.return_type to deduce derived func return type
NHDaly Jun 23, 2020
a160dfc
Salsa: Add type assertion to reduce allocations by 2!
NHDaly Jun 23, 2020
ae37237
Decrease Salsa DefaultStorage lock contention via Atomic
NHDaly Jun 26, 2020
c8ad531
Reduce allocs in Salsa derived funcs: pre-size Traces to hold 30 funcs
NHDaly Jun 26, 2020
68ad5f0
Reduce Salsa allocs: Disable Salsa stacks if !debug_enabled()
NHDaly Jun 26, 2020
db5b4a9
Salsa: Simplify logic in memoized_lookup (perf neutral)
NHDaly Jun 26, 2020
2368d1d
Salsa perf: remove type annotations from Salsa._unwrap_salsa_value().
NHDaly Jun 26, 2020
d94a543
Salsa: improve perf by strongly typing derived funcs map
NHDaly Jun 26, 2020
a29ff3e
Salsa: Finally massively simplify DependencyKey types.
NHDaly Jun 26, 2020
9e47e92
Salsa: Fix bugs from Salsa perf changes
NHDaly Jun 26, 2020
782b5b4
Fix Salsa tests by typing the DerivedValues w/ ResultType
NHDaly Jun 28, 2020
d3837fd
Use Base at-lock instead of lock-do to improve performance
NHDaly Jun 28, 2020
1404abe
Disable `return_types()` inside memoized_lookup because it's hanging.
NHDaly Jun 28, 2020
350c118
Tried to use one large dict for derived vals, but it causes more allocs
NHDaly Jun 29, 2020
9b3c7c8
Revert "Tried to use one large dict for derived vals, but it causes m…
NHDaly Jun 29, 2020
840d967
Disable return_type inference in Salsa b/c it's hanging in Delve.
NHDaly Jun 29, 2020
3ed4c0d
Merge branch 'master' into nhd-Salsa-performance-tuning
NHDaly Jul 13, 2020
9a96f9d
Salsa default storage optimization: Reuse dependency vectors via swap.
NHDaly Jul 13, 2020
fe2da2e
Performance optimization to skip tracking dependencies during still_v…
NHDaly Jun 29, 2020
43167f8
Salsa: Add comment for prealloc traces
NHDaly Jul 2, 2020
2aa4d27
Coallesce all the nospecialize comments into a single comment at top
NHDaly Jul 2, 2020
25f67c9
Disable salsa traces doubling test.
NHDaly Jul 13, 2020
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
Prev Previous commit
Next Next commit
Salsa: Add comment for prealloc traces
NHDaly committed Jul 13, 2020

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 43167f860452d33daa9d726001b1d32c2a2a9f55
2 changes: 2 additions & 0 deletions src/Salsa.jl
Original file line number Diff line number Diff line change
@@ -231,6 +231,8 @@ mutable struct TraceOfDependencyKeys
# since we're only tracing the immediate dependencies of that function.
function TraceOfDependencyKeys()
# Pre-allocate all traces to be non-empty, to minimize allocations at runtime.
# These traces are all constructed once ahead of time in the per-thread trace pools,
# so this initialization is only done once during Module __init__().
# TODO: Tune this. Too big wastes RAM (though, it's fixed cost up front).
# Current size, 30, adds about 1MiB, which seems not bad.
N = 30