Skip to content

Instantly share code, notes, and snippets.

(a) time (b) time (c) time (d) time (e) time (a) mem (b) mem (c) mem (d) mem (e) mem
large-file-1mb.txt 0 0.01 0.01 0.14 0.04 1868 7376 6220 11832 12552
large-file-10mb.txt 0 0.02 0.01 0.14 0.04 1824 18124 6316 11828 12744
large-file-100mb.txt 0.02 0.12 0.06 0.14 0.07 1780 128160 6356 11776 12816
large-file-1gb.txt 0.19 1.75 0.54 0.24 0.2 1872 1235448 6360 11684 12732
(a) time (b) time (c) time (d) time (e) time (a) mem (b) mem (c) mem (d) mem (e) mem
large-file-1mb.txt 0 0.03 0.01 0.17 0.07 1868 9428 7664 14892 15368
large-file-10mb.txt 0 0.04 0.02 0.16 0.07 1780 27784 7672 14944 15536
large-file-100mb.txt 0.01 0.29 0.08 0.16 0.1 1876 213252 7696 15056 15408
large-file-1gb.txt 0.18 13.09 0.66 0.26 0.25 1856 1911580 7704 15112 15396
@okumura
okumura / wc-py-result.csv
Created November 24, 2019 23:25
wc-l python benchmark
(a) time (b) time (c) time (d) time (e) time (a) mem (b) mem (c) mem (d) mem (e) mem
large-file-1mb.txt 0 0.01 0.01 0.14 0.04 1868 7376 6220 11832 12552
large-file-10mb.txt 0 0.02 0.01 0.14 0.04 1824 18124 6316 11828 12744
large-file-100mb.txt 0.02 0.12 0.06 0.14 0.07 1780 128160 6356 11776 12816
large-file-1gb.txt 0.19 1.75 0.54 0.24 0.2 1872 1235448 6360 11684 12732
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing
import os
import sys
import time
import threading
import concurrent.futures as futures
@okumura
okumura / wc-mp-pool.py
Created November 24, 2019 22:50
wc -l
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing
import os
import sys
import time
import threading
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def wc_block_64k(name, blocksize=65536):
def blocks(f):
while True:
b = f.read(blocksize)
@okumura
okumura / wc-naive.py
Created November 24, 2019 22:49
wc -l
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def wc_naive(name):
with open(name, 'r') as f:
return sum(1 for line in f)
@okumura
okumura / map_clsloc.txt
Created January 29, 2018 09:10 — forked from aaronpolhamus/map_clsloc.txt
Image net classes + labels
n02119789 1 kit_fox
n02100735 2 English_setter
n02110185 3 Siberian_husky
n02096294 4 Australian_terrier
n02102040 5 English_springer
n02066245 6 grey_whale
n02509815 7 lesser_panda
n02124075 8 Egyptian_cat
n02417914 9 ibex
n02123394 10 Persian_cat
@okumura
okumura / get_conv_outsize_2d.py
Created February 24, 2017 12:59
get_conv_outsize_2d()
# -*- coding: utf-8 -*-
from chainer.links.connection.convolution_2d import _pair
from chainer.utils.conv import get_conv_outsize
def get_conv_outsize_2d(size, k, s, p=0, cover_all=False, d=1):
sizeh, sizew = _pair(size)
kh, kw = _pair(k)
sh, sw = _pair(s)
ph, pw = _pair(p)
@okumura
okumura / check-ios-app-signing-info.sh
Created April 1, 2014 07:59
Check iOS app signing info.
security find-identity -p codesigning -v