Last active
March 4, 2017 07:08
-
-
Save smetj/718cd80eccc3c8cf8b669a2a08658aab to your computer and use it in GitHub Desktop.
Measure time of eval() a dict string into an actual dict object
This file contains hidden or 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
#!/usr/bin/python | |
from testlap import TestLap | |
class DictEval(): | |
''' | |
eval() a dict string into an actual dict object | |
''' | |
def __init__(self): | |
self.dict_string = '{"one": 1, "two": 2, "three": {"two.one": 21 }}' | |
def test_eval_dict(self): | |
'''Load dict string''' | |
d = eval(self.dict_string) | |
if __name__ == '__main__': | |
instance=DictEval() | |
test_lap=TestLap(instance=instance, iterations=1000000) | |
test_lap.go() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Testlap is used https://github.com/smetj/testlap