push
github
Fix performance issue in parsing bit indices in QPY (#11944) (#11945) * Fix performance issue in parsing bit indices in QPY This commit fixes a performance issue in the deserialization of QPY payloads. Previously when parsing every instruction the deserialization would build up a dictionary of indices to bits so that when we load the bit index in the qargs and cargs for each instruction. This mean the worst case scaling of this section was O(n * m) for n instructions and m bits, which for very large circuits could end up dominating the time spent in deserialization. However, this was unecessary work because it is rebuilding a mapping from index to bit as a dictionary, but that mapping already existed in the bit lists the circuit is carrying around. This commit fixes the performance issue by removing the dictionary generation and just using the bit lists directly. * Add release note * Simplify logic (cherry picked from commit f4b50fbb2) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
2 of 2 new or added lines in 1 file covered. (100.0%)
6 existing lines in 1 file now uncovered.58900 of 65974 relevant lines covered (89.28%)
184773.32 hits per line