amazon-braket-sdk-python icon indicating copy to clipboard operation
amazon-braket-sdk-python copied to clipboard

perf: use dicts instead of ordered dicts

Open AbeCoull opened this issue 1 year ago • 1 comments

Issue #, if available:

Description of changes: As of Python 3.7, dicts are now ordered. This removes the need for another import.

Testing done:

import timeit

print(timeit.timeit("from collections import OrderedDict"))
print(timeit.timeit("OrderedDict()", setup="from collections import OrderedDict"))
print(timeit.timeit("{}"))


>>>0.4242547479807399
>>>0.06917781697120517
>>>0.02174670697422698

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • [ ] I have read the CONTRIBUTING doc
  • [ ] I used the commit message format described in CONTRIBUTING
  • [ ] I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • [ ] I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • [ ] I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

AbeCoull avatar Mar 12 '24 17:03 AbeCoull

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (f556567) to head (38e7ff2).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #910   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          134       134           
  Lines         8911      8909    -2     
  Branches      2008      2008           
=========================================
- Hits          8911      8909    -2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 12 '24 17:03 codecov[bot]