ファイルと結合 + bzip2 の最速の実行手段を試すべく、以下の二つを比較してみた
- 外部コマンド(/bin/cat, /bin/bzip2) で実行した場合
- pure python で実行した場合
タブ区切りのテキストが数十万行入ったテキストファイルを6つ持ってきて、それを結合して bzip2 する、というシナリオを使う。
#!/usr/bin/env python | |
from benchmarker import Benchmarker | |
from collections import Counter | |
with Benchmarker(width=20) as bm: | |
counters = [Counter(), Counter(), Counter(), Counter()] | |
with bm('double loop'): |
#!/usr/bin/env python | |
from multiprocessing import Pool | |
import redis | |
MAX_LOOP_COUNT = 100 | |
db = redis.StrictRedis(host='localhost', port=6379, db=0) | |
db.delete('hoge') | |
#!/usr/bin/env python | |
import boto | |
conn=boto.connect_s3('api_key','api_secret') | |
bucket=conn.get_bucket('bucket_name'); | |
keys=bucket.list('path/to/folder') | |
size=0 | |
for key in keys: | |
print "%s:%d" % (key, key.size) | |
size+= key.size |
diff -ur mt7610u_wifi_sta_v3002_dpo_20130916.orig/include/os/rt_linux.h mt7610u_wifi_sta_v3002_dpo_20130916/include/os/rt_linux.h | |
--- mt7610u_wifi_sta_v3002_dpo_20130916.orig/include/os/rt_linux.h 2013-09-16 23:03:08.000000000 +0900 | |
+++ mt7610u_wifi_sta_v3002_dpo_20130916/include/os/rt_linux.h 2014-04-29 23:26:16.254488178 +0900 | |
@@ -277,8 +277,8 @@ | |
typedef struct _OS_FS_INFO_ | |
{ | |
- int fsuid; | |
- int fsgid; | |
+ kuid_t fsuid; |
class First(object): | |
def __init__(self, a, b): | |
self.x = "first init %s" % a | |
self.y = "first init %s" % b | |
print "invoked!" | |
class Second(First): | |
pass |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from benchmarker import Benchmarker | |
import os | |
import bz2 | |
import glob | |
import fnmatch | |
from shutil import copyfileobj |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from benchmarker import Benchmarker | |
import os | |
import glob | |
import fnmatch | |
import subprocess |
次世代サーバ見積もり
パーツ項目 | 品名 | 価格 |
---|---|---|
CPU | Xeon E5-2618Lv2 (2.0G) 6core/12thread TDP50W | 69,929 |
マザーボード | GIGABYTE GA-6PXSV4 | 41,999 |
RAM | 既存のモノを使う | - |
ケース | Coolermaster Silencio 652 | 18,900 |
電源 | 玄人志向 SSシリーズ 350W 80PLUS GOLD KRPW-SS350W/90+ | 6,234 |
CPUクーラー | [SCYTHE] 刀4 KATANA4 SCKTN-4000 | 3,980 |
PING digitalocean.mumumu.org (128.199.255.63) 56(84) bytes of data.
64 bytes from digitalocean.mumumu.org (128.199.255.63): icmp_req=1 ttl=51 time=104 ms
64 bytes from digitalocean.mumumu.org (128.199.255.63): icmp_req=2 ttl=50 time=86.4 ms
64 bytes from digitalocean.mumumu.org (128.199.255.63): icmp_req=3 ttl=51 time=92.6 ms
64 bytes from digitalocean.mumumu.org (128.199.255.63): icmp_req=4 ttl=51 time=81.4 ms
64 bytes from digitalocean.mumumu.org (128.199.255.63): icmp_req=5 ttl=51 time=91.3 ms
64 bytes from digitalocean.mumumu.org (128.199.255.63): icmp_req=6 ttl=51 time=99.2 ms
64 bytes from digitalocean.mumumu.org (128.199.255.63): icmp_req=7 ttl=51 time=91.9 ms
64 bytes from digitalocean.mumumu.org (128.199.255.63): icmp_req=8 ttl=50 time=82.2 ms