Skip to content

Instantly share code, notes, and snippets.

@MOON-CLJ
MOON-CLJ / tokudb_install
Last active December 18, 2015 07:29
install tokudb
~/.bashrc
alias gcc='/usr/local/bin/gcc'
export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
CFLAGS="-O3 -g -fno-exceptions -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing"
CXXFLAGS="-O3 -g -fno-exceptions -fno-rtti -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing"
export CFLAGS CXXFLAGS
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/scws/lib/:/home/arthas/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/sbin
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
export PATH=$PATH:/usr/local/tokutek/mysql/bin/
@MOON-CLJ
MOON-CLJ / gist:5213953
Last active December 15, 2015 06:09
text xapian_weibo index performance
index_text用法 replace
[2013-03-21 22:44:49] folder[_hehe_2011-08-21] num indexed: 350000
[2013-03-21 22:44:57] folder[_hehe_2010-12-14] num indexed: 360000
[2013-03-21 22:45:05] folder[_hehe_2010-12-14] num indexed: 370000
[2013-03-21 22:45:11] folder[_hehe_2010-04-08] num indexed: 380000
[2013-03-21 22:45:17] folder[_hehe_2010-10-25] num indexed: 390000
[2013-03-21 22:45:25] folder[_hehe_2011-07-02] num indexed: 400000
[2013-03-21 22:45:34] folder[_hehe_2011-10-10] num indexed: 410000
[2013-03-21 22:45:43] folder[_hehe_2011-02-02] num indexed: 420000
[2013-03-21 22:45:51] folder[_hehe_2011-02-02] num indexed: 430000
@MOON-CLJ
MOON-CLJ / decorator.py
Last active December 14, 2015 16:19
some python usage snippet
3,
def timeit(method):
def timed(*args, **kw):
ts = time()
result = method(*args, **kw)
te = time()
logging.info('%r %2.2f sec' % (method.__name__, te-ts))
return result
return timed
#!/usr/bin/python
__doc__ = """Tiny HTTP Proxy.
This module implements GET, HEAD, POST, PUT and DELETE methods
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT
method is also implemented experimentally, but has not been
tested yet.
Any help will be greatly appreciated. SUZUKI Hisao
@MOON-CLJ
MOON-CLJ / ipython_test
Last active December 13, 2015 19:49
ipython map,list comprehensions,与python自带的map对比的性能测试
在macbook pro 4核上的测试结果,python自带的map表现比起ipython 的map,list comprehensions都要好。但是有优化的multi_mcpi还是不错。
$ ipcluster start --n=4
print mcpi(100000000)
#print multi_mcpi_by_map(dview, 100000000) # 传递太耗时
#print multi_mcpi_by_list_comp(dview, 100000000)
#print multi_mcpi(dview, 100000000)
$ time py multi_mcpi.py
importing random from random on engine(s)