These benchmarks were done on Windows 7 64 bit, AMD Phenom II X3 720 Process 2.80 GHz, 4 GB RAM
10,000 Objects Created
-
NodeJs 0.6.13 Finished in: 30ms
-
PHP 5.4 Finished in: 37ms
-
Python 3.2.2 Finished in: 70ms
| "Customize Flask to select a template based on some criteria." | |
| import os | |
| from flask import Flask, request, render_template | |
| from flask.helpers import locked_cached_property | |
| from jinja2 import FileSystemLoader, TemplateNotFound | |
| # Import a detection utility from your project, not defined here. | |
| # Takes a request object and returns True if browser is mobile. |
| (function() { | |
| function DateDiff(date1, date2) { | |
| this.days = null; | |
| this.hours = null; | |
| this.minutes = null; | |
| this.seconds = null; | |
| this.date1 = date1; | |
| this.date2 = date2; |
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
| /* | |
| * This work is free. You can redistribute it and/or modify it under the | |
| * terms of the Do What The Fuck You Want To Public License, Version 2, | |
| * as published by Sam Hocevar. See the COPYING file for more details. | |
| */ | |
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { |
| #!/bin/bash | |
| ############################## | |
| # dnspodsh v0.3 | |
| # 基于dnspod api构架的bash ddns客户端 | |
| # 作者:zrong(zengrong.net) | |
| # 详细介绍:http://zengrong.net/post/1524.htm | |
| # 创建日期:2012-02-13 | |
| # 更新日期:2012-03-11 | |
| ############################## |
| #!/bin/sh | |
| # Ref: http://ubuntuforums.org/showthread.php?t=1751455 | |
| # Uninstall PIL | |
| # sudo pip uninstall PIL -q | |
| # Install required libs | |
| apt-get --yes install build-essential python-dev zlib1g-dev liblcms1-dev libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev | |
| # Link to correct location |
These benchmarks were done on Windows 7 64 bit, AMD Phenom II X3 720 Process 2.80 GHz, 4 GB RAM
10,000 Objects Created
NodeJs 0.6.13 Finished in: 30ms
PHP 5.4 Finished in: 37ms
Python 3.2.2 Finished in: 70ms
| # -*- coding:utf-8 -*- | |
| import requests | |
| from time import sleep | |
| from threading import Thread | |
| UPDATE_INTERVAL = 0.01 | |
| class URLThread(Thread): | |
| def __init__(self, url, timeout=10, allow_redirects=True): | |
| super(URLThread, self).__init__() |
| RANDOM-WRITE RESULTS(1000k records) | |
| =================================== | |
| Keys: 16 bytes each | |
| Values: 80 bytes each | |
| Entries: 1000000 | |
| IndexSize: 23.8 MB (estimated) | |
| DataSize: 80.1 MB (estimated) | |
| --------------------------------------------------------------------------------------------------- | |
| nessDB: version 1.8(LSM-Tree storage engine) | |
| Date: Thu Mar 29 16:49:40 2012 |
| # -*- coding:utf-8 -*- | |
| import requests, os, re, sys, time | |
| from time import sleep | |
| from threading import Thread | |
| reload(sys) | |
| sys.setdefaultencoding('utf8') | |
| UPDATE_INTERVAL = 0.01 |