mirror of
https://github.com/Z3Prover/z3
synced 2026-07-15 03:25:43 +00:00
remove_element uses swap-remove but deep-copied the relocated tail coefficient. In namespace lp the coefficient type is rational (copyable), so this allocates on the heap for large coefficients. Since the tail element is popped right after, relocate large coefficients by swapping instead, avoiding the allocation; small coefficients still use a plain copy (cheaper than swapping mpz internals). Reported in Z3Prover/bench#3143 (remove_element was the top hotspot). Verified correctness-neutral (identical results, 92/92 unit tests); ~1.5% faster on the certora large-coefficient set, neutral on small-coefficient inputs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fd5693e4-3b1d-4dac-b3be-2942ae6f31f8 |
||
|---|---|---|
| .. | ||
| ackermannization | ||
| api | ||
| ast | ||
| cmd_context | ||
| math | ||
| model | ||
| muz | ||
| nlsat | ||
| opt | ||
| params | ||
| parsers | ||
| qe | ||
| sat | ||
| shell | ||
| smt | ||
| solver | ||
| tactic | ||
| test | ||
| util | ||
| CMakeLists.txt | ||