Skip to content

Commit a58e342

Browse files
committed
analyzer: presize m_cluster_map in store copy ctor
Testing cc1 on pr93032-mztools-unsigned-char.c Benchmark #1: (without patch) Time (mean ± σ): 338.8 ms ± 13.6 ms [User: 323.2 ms, System: 14.2 ms] Range (min … max): 326.7 ms … 363.1 ms 10 runs Benchmark gcc-mirror#2: (with patch) Time (mean ± σ): 332.3 ms ± 12.8 ms [User: 316.6 ms, System: 14.3 ms] Range (min … max): 322.5 ms … 357.4 ms 10 runs Summary ./cc1.new ran 1.02 ± 0.06 times faster than ./cc1.old gcc/analyzer/ChangeLog: * store.cc (store::store): Presize m_cluster_map. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
1 parent b5baf56 commit a58e342

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gcc/analyzer/store.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,8 @@ store::store ()
20322032
/* store's copy ctor. */
20332033

20342034
store::store (const store &other)
2035-
: m_called_unknown_fn (other.m_called_unknown_fn)
2035+
: m_cluster_map (other.m_cluster_map.elements ()),
2036+
m_called_unknown_fn (other.m_called_unknown_fn)
20362037
{
20372038
for (cluster_map_t::iterator iter = other.m_cluster_map.begin ();
20382039
iter != other.m_cluster_map.end ();

0 commit comments

Comments
 (0)