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

cdgriffith / Box
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: develop
DEFAULT BRANCH: master
Repo Added 11 Mar 2017 05:41AM UTC
Files 8
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH 134-crud-speedup-jkylling
branch: 134-crud-speedup-jkylling
CHANGE BRANCH
x
Reset
  • 134-crud-speedup-jkylling
  • 1.0.0
  • 2.1.0
  • 2.2.1
  • 3.0.0
  • 3.0.1
  • 3.1.0
  • 3.1.1
  • 3.2.0
  • 3.2.1
  • 3.2.2
  • 3.2.3
  • 3.2.4
  • 3.4.0
  • 3.4.1
  • 3.4.2
  • 3.4.3
  • 3.4.4
  • 3.4.5
  • 3.4.6
  • 3.7_fixes
  • 4.0
  • 4.0.0
  • 4.0.1
  • 4.0.2
  • 4.0.3
  • 4.0.4
  • 4.1.0
  • 4.2.0
  • 4.2.1
  • auto_attr
  • bugfix-141
  • conversion_box_raise_errors
  • develop
  • development
  • development-3.x
  • feature-unicode-tests-and-benchmarksd
  • feature-url_download
  • feature/pwwang-box-intact-types
  • heritage
  • issue-48
  • maintenance-2.2
  • master
  • ordered_box
  • revert-81-master
  • sdementen

pending completion
456

push

travis-ci

web-flow
Speed up crud operations. (#134)

* Speed up crud operations.

This fixes [#129](https://github.com/cdgriffith/Box/issues/129).

Because of `_conversion_checks` the complexity of a single `__setattr__` is something like O(number_of_keys * key_size). Hence the complexity of merge_update would be O(number_of_keys * number_of_keys * key_size). This comes as a surprise when you expect the complexity to be O(number_of_keys * log(number_of_keys)).

This PR addresses this performance issue by using a dictionary mapping safe keys to old keys.

All the unit tests are passing. I am not familiar enough with Box to know if the use of `__setattr__` and `__setitem__` might lead to an inconsistent state of the Box, or if the unit tests cover this. Eventually, you might consider refactoring the code a bit (this is better done by the author who knows the code well).

* Fix linter errors

770 of 773 relevant lines covered (99.61%)

3.98 hits per line

Relevant lines Covered
Build:
Build:
773 RELEVANT LINES 770 COVERED LINES
3.98 HITS PER LINE
Source Files on 134-crud-speedup-jkylling
  • List 0
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
456 134-crud-speedup-jkylling Speed up crud operations. (#134) * Speed up crud operations. This fixes [#129](https://github.com/cdgriffith/Box/issues/129). Because of `_conversion_checks` the complexity of a single `__setattr__` is something like O(number_of_keys * key_... push 22 Feb 2020 03:16PM UTC web-flow travis-ci pending completion  
455 134-crud-speedup-jkylling Version 4.0.4 (#125) * Fixing `get` to return None when not using default box (thanks to Jeremiah Lowin) * Updating outdated docs push 22 Feb 2020 03:14PM UTC web-flow travis-ci pending completion  
See All Builds (529)
  • Repo on GitHub
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