Last active
January 8, 2016 17:46
-
-
Save boris-42/ed8d1572929988234709 to your computer and use it in GitHub Desktop.
oslo.utils testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from oslo_utils import reflection | |
REPEAT = 1000000 | |
RANGE = range(REPEAT) | |
class A(object): | |
pass | |
def main(): | |
resource = A() | |
start = time.time() | |
for i in RANGE: | |
resource.__class__.__name__ | |
print(time.time() - start) | |
start = time.time() | |
for i in RANGE: | |
reflection.get_class_name(resource, fully_qualified=False) | |
print(time.time() - start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment