A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://gist.github.com/923927 below:

Time stdlib json against simplejson · GitHub

Created April 17, 2011 10:32

Clone this repository at <script src="https://gist.github.com/vsajip/923927.js"></script>

Save vsajip/923927 to your computer and use it in GitHub Desktop.

Time stdlib json against 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 Python 2.7 ========== Python version: 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) [GCC 4.5.2] 11.21484375 KiB read Timing simplejson: 0.271898984909 Timing stdlib json: 0.338716030121 Python 3.2 ========== Python version: 3.2 (r32:88445, Mar 25 2011, 19:28:28) [GCC 4.5.2] 11.21484375 KiB read Timing simplejson: 0.3150200843811035 Timing stdlib json: 0.32146596908569336 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 urllib from timeit import timeit if sys.version_info[0] < 3: from urllib import urlopen else: from urllib.request import urlopen s = urlopen('http://flingo.tv/api2/get_items?app_id=flingo&guid=abc123&howmany=8').read().decode('utf-8') print('Python version: %s' % sys.version) print("%s KiB read" % (float(len(s))/1024)) stmt = 'd = json.loads(s);x = json.dumps(d)' setup='import simplejson as json;from __main__ import s' print('Timing simplejson:') print(timeit(stmt, setup=setup, number=1000)) setup='import json;from __main__ import s' print('Timing stdlib json:') print(timeit(stmt, setup=setup, number=1000))

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4