Skip to content

Instantly share code, notes, and snippets.

View dchentech's full-sized avatar
🎯
Focusing

David Chen dchentech

🎯
Focusing
View GitHub Profile
# -*-coding:utf-8-*-
'''cjson, jsonlib, simplejson, and yajl also use C code
demjson did not use C code, but was too painfully slow to benchmark
(took about 20 seconds for these tests)
'''
import json
import sys
import time
@dchentech
dchentech / enc_dec_test.py
Last active August 29, 2015 14:20 — forked from justinfx/enc_dec_test.py
Speed test of common serializers on python 2.7.9 (pickle, cPickle, ujson, cjson, simplejson, json, yajl, msgpack, Python builtin)
"""
Dependencies:
pip install tabulate simplejson python-cjson ujson yajl msgpack-python
"""
from timeit import timeit
from tabulate import tabulate
@dchentech
dchentech / local_benchmark.py
Created May 13, 2015 05:24
JSON VS eval performance benchmark, see requirement at https://github.com/spotify/luigi/pull/939
# -*-coding:utf-8-*-
from etl_utils import process_notifier
from collections import Counter, defaultdict
import ujson
null = None
def char_count(func):
result = defaultdict(int)
@dchentech
dchentech / Discussion
Last active June 5, 2018 18:50
The Google Trends of 4 Web Frameworks Between 2005-2018:\nRuby on Rails, NodeJS, Python Flask, Java Spring.
Web development technologies change quickly in the recent decade. This visualisation displays the popularity change of 4 web frameworks. I scraped the data from Google Trends website. And here I choose the original colour of each web framework logo as the colours of time series.
When we look at this chart, we would easily find all web frameworks are becoming more popular than the past, except Ruby on Rails. Before 2005, Java was the mainstream way to build websites. When Web 2.0 SNS time came, people demanded an easy full-stack way to build the websites quickly. Ruby on Rails became popular due to its Convention over Configuration principle and the dynamic of Ruby programming language. Between 2007 and 2010, people find the shortcoming of Ruby on Rails is hard to maintain when the business and websites grow, and also the poor performance. After 2011, the market demanded more complicated frontend technology to provide more complex user experience, NodeJS came to solve this problem, and NodeJS also improved