• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 15864966871

25 Jun 2025 01:13AM UTC coverage: 87.969% (-0.03%) from 87.998%
15864966871

Pull #14665

github

mergify[bot]
Use Arc instead of Box for internal expression nodes in SymbolExpr (#14660)

This commit updates the internal construction of the SymbolExpr struct
use a reference counting pointer instead of a regular pointer to a heap
allocated object. The way the binary tree gets constructed internally
using a normal pointer results in a lot of a copies of elements on the
tree. This creates a large performance overhead for the symbol expr as
we end up copying and freeing elements on the binary tree a large
amount. This was the root cause of the regression reported in #14653
as the expression that gets generated by the transpiler internally ends
up adding a lot of elements to global phase expression and that results
in a lot of memory allocation and deallocation overhead. By using a
reference counting pointer instead of creating and freeing copies of
the expressions on the tree we instead only keep a single copy and
just increment or decrement the reference count.

Fixes #14653

(cherry picked from commit 3b2600202)
Pull Request #14665: Use Arc instead of Box for internal expression nodes in SymbolExpr (backport #14660)

48 of 71 new or added lines in 3 files covered. (67.61%)

35 existing lines in 4 files now uncovered.

83036 of 94392 relevant lines covered (87.97%)

517210.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.38
/crates/circuit/src/symbol_parser.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc