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/env python2.7 | |
# -*- coding: utf-8 -*- | |
# | |
# Benchmark the relative performance of stdlib's json, simplejson, ujson, and | |
# a wrapped simplejson that gives the same API as stdlib's json. | |
import benchmark | |
import hashlib | |
import json as stdjson | |
import simplejson |
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/env python | |
import sys | |
import os.path | |
import subprocess | |
import tempfile | |
import re | |
import json | |
import shutil | |
import atexit |
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/env python | |
# | |
# Make some big rings for testing. Doesn't do command-line arg parsing or | |
# anything fancy; just go change the hard-coded constants. It's not like | |
# you're going to run this more than a few times before tossing it out. | |
import os | |
import subprocess | |
# clean up from previous runs, if any |
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/env python | |
# | |
# flake8-checks the staged versions of any changed python files | |
import os.path | |
import subprocess | |
import tempfile | |
import shutil | |
import atexit | |
tempdir = tempfile.mkdtemp() |
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/env python | |
import benchmark | |
import Queue | |
import threading | |
import os | |
class BenchQueueStuff(benchmark.Benchmark): | |
def setUp(self): |
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/env python | |
import benchmark | |
import Queue | |
import os | |
import subprocess | |
import tempfile | |
import time | |
import threading |
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
* Are there tests? Do the new tests fail if the code is reverted? | |
* Does it work? There's no such thing as obviously correct, as I've had to learn again and again. | |
* Check the coverage report; is any new code uncovered? (This might be okay, but take a look.) | |
* How's the logging? | |
* Read all the tests; any leftover debugging cruft? Print statements seem particularly common. |
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/env python | |
import os | |
from swift.common.utils import get_logger | |
NLOGGERS = 500 | |
for _ in xrange(NLOGGERS): | |
get_logger({}) |
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/env python | |
import benchmark | |
import heapq | |
class BenchHeapq(benchmark.Benchmark): | |
def eachSetUp(self): | |
self.size = 500 |
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/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Benchmark the relative performance of stdlib's json, simplejson, and | |
# a wrapped simplejson that gives the same API as stdlib's json. | |
import benchmark | |
import hashlib | |
import json as stdjson | |
import simplejson |