mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Add LayoutInterner to LayoutCache
Adds a thread-local interner of layouts to LayoutCache, and updates all references appropriately. This is a bit suboptimal for single-threaded workloads that will look at creating layout caches again, like the REPL, but I think that's okay for now - since the global interner will be uncontested for those workloads, it should still be plenty fast to access the interner, even behind a lock.
This commit is contained in:
parent
9d170be5c7
commit
c5466810a4
19 changed files with 177 additions and 86 deletions
|
@ -510,7 +510,7 @@ fn start_phase<'a>(
|
|||
IdentIds::default(),
|
||||
Subs::default(),
|
||||
ProcsBase::default(),
|
||||
LayoutCache::new(state.target_info),
|
||||
LayoutCache::new(state.layout_interner.fork(), state.target_info),
|
||||
ModuleTiming::new(Instant::now()),
|
||||
)
|
||||
} else if state.make_specializations_pass.current_pass() == 1 {
|
||||
|
@ -2486,10 +2486,9 @@ fn update<'a>(
|
|||
if state.goal_phase() > Phase::SolveTypes
|
||||
|| matches!(state.exec_mode, ExecutionMode::ExecutableIfCheck)
|
||||
{
|
||||
let layout_cache = state
|
||||
.layout_caches
|
||||
.pop()
|
||||
.unwrap_or_else(|| LayoutCache::new(state.target_info));
|
||||
let layout_cache = state.layout_caches.pop().unwrap_or_else(|| {
|
||||
LayoutCache::new(state.layout_interner.fork(), state.target_info)
|
||||
});
|
||||
|
||||
let typechecked = TypeCheckedModule {
|
||||
module_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue