Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix performance issue in parsing bit indices in QPY (backport #11944) #11945

Merged
merged 1 commit into from
Mar 4, 2024

Commits on Mar 4, 2024

  1. Fix performance issue in parsing bit indices in QPY (#11944)

    * 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 f4b50fb)
    mtreinish authored and mergify[bot] committed Mar 4, 2024
    Configuration menu
    Copy the full SHA
    e5e337f View commit details
    Browse the repository at this point in the history