mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
limit morphic to trivial analysis to avoid inplace mutation bugs
Surprisingly this actually increases perf of some benchmarks. My guess is that it fixes bugs during looping and thus reduces work. Specifically cFold and derive see minor gains ~1.5%; rBTreeCk sees a big gain ~4%. NQueens is the only benchmark that sees a lost at ~2%. False interpreter also see a 0-5% perf improvement depending on the exact input. That said, the improvement was noisy. ref #7367
This commit is contained in:
parent
a0de21d7d7
commit
1830b3a1f4
1 changed files with 6 additions and 4 deletions
|
@ -358,7 +358,9 @@ where
|
|||
|
||||
match opt_level {
|
||||
OptLevel::Development | OptLevel::Normal => morphic_lib::solve_trivial(program),
|
||||
OptLevel::Optimize | OptLevel::Size => morphic_lib::solve(program),
|
||||
// TODO(#7367): Change this back to `morphic_lib::solve`.
|
||||
// For now, using solve_trivial to avoid bug with loops.
|
||||
OptLevel::Optimize | OptLevel::Size => morphic_lib::solve_trivial(program),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1026,10 +1028,10 @@ fn lowlevel_spec<'a>(
|
|||
let _unit1 = builder.add_touch(block, cell)?;
|
||||
let _unit2 = builder.add_update(block, update_mode_var, cell)?;
|
||||
|
||||
builder.add_bag_insert(block, bag, to_insert)?;
|
||||
let new_bag = builder.add_bag_insert(block, bag, to_insert)?;
|
||||
|
||||
let old_value = builder.add_bag_get(block, bag)?;
|
||||
let new_list = with_new_heap_cell(builder, block, bag)?;
|
||||
let old_value = builder.add_bag_get(block, new_bag)?;
|
||||
let new_list = with_new_heap_cell(builder, block, new_bag)?;
|
||||
|
||||
// depending on the types, the list or value will come first in the struct
|
||||
let fields = match interner.get_repr(layout) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue