3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-15 03:25:43 +00:00
z3/src
Lev Nachmanson 4cb997c128 lp: avoid heap allocation when relocating coefficients in static_matrix::remove_element
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
2026-07-13 15:00:14 -07:00
..
ackermannization block ackermann over nested selects 2026-06-19 10:41:56 -07:00
api Java API: return EnumSort instead of DatatypeSort from Sort.create() (#10104) 2026-07-12 21:46:46 -07:00
ast Fix assertion violation in bv2int_translator with smt.bv.solver=2 (#10109) 2026-07-12 21:56:12 -07:00
cmd_context Set pi.avoid_skolems=false for TPTP solver runs (#10100) 2026-07-12 19:21:25 -07:00
math lp: avoid heap allocation when relocating coefficients in static_matrix::remove_element 2026-07-13 15:00:14 -07:00
model updates to tptp_frontend 2026-07-04 14:34:21 -07:00
muz Spacer QE: avoid assertion on extended arithmetic model values and add #3845 regression (#10096) 2026-07-12 18:52:44 -07:00
nlsat Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt opt: validate strict optimization optima faithfully with delta-rational bounds (#10059) 2026-07-09 10:39:23 -07:00
params expose avoid-skolems parameter to deal with TPTP problems 2026-07-12 18:54:31 -07:00
parsers Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
qe Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
sat Issue 438 (#10085) 2026-07-12 13:35:57 -07:00
shell Fixes necessary to compile z3 included in clang-tidy via FetchContents. (#9768) 2026-06-08 19:44:01 -07:00
smt Add linear divisibility closure lemma for lp/nla solver (#7464) (#10107) 2026-07-12 21:20:50 -07:00
solver Fix unsigned overflow in parallel solver conflict budget escalation (#10076) 2026-07-10 15:25:57 -07:00
tactic Issue 438 (#10085) 2026-07-12 13:35:57 -07:00
test Fix api_datalog test: reuse of Z3_context across set-logic calls (#10101) 2026-07-12 20:32:02 -07:00
util bug fixes to ho_matching - offset alignment inv_var_shift, callback scopes should not be nested, allow bindings that are not ground 2026-07-09 19:16:12 -07:00
CMakeLists.txt git bindings v1.0 2026-02-18 21:02:25 -08:00