Skip to content

Instantly share code, notes, and snippets.

View umegaya's full-sized avatar

iyatomi takehiro umegaya

View GitHub Profile
local serpent = require 'lib.serpent'
local b = {text="ha'ns", ['co\nl or']='bl"ue', str="\"\n'\\\000"}
local c = function() return 1 end
local d = {'sometable'}
local a = {
x=1, [true] = {b}, [not true]=2, -- boolean as key
['true'] = 'some value', -- keyword as a key
z = c, -- function as value
list={'a',nil,nil, -- embedded nils
--[[
t = setmetatable({x = "a"}, {
__index = function (t, k)
return setmetatable({x = k}, {
__call = function (t, a1, ...)
print(t, a1, t and t.x or "nil", a1 and a1.x or "nil")
end,
})
end,
})
@umegaya
umegaya / gist:2d2816c31cbca41ab95d
Last active August 29, 2015 14:04
innovation application

テーマ

  • 人々の創造性を最大限引き出し、増幅させる分散コンピューティング環境の開発

実現したい目標

  • 分散コンピューティングをいままでよりもずっと自由に、簡単に行うことができるプログラミング環境を作ることで、人々の創造性を最大限引き出し、増幅させる

人々が創造性を発揮するには巨大なコンピューティング能力をもっと自在に操れることが必要

  • 現代の創造性の発露はかなりの部分がネットワークを通じたサービスの提供を通じて行われるため
@umegaya
umegaya / gist:0ddc3d53787bf477435d
Last active August 29, 2015 14:04
pulpo benchmarking on aws (m3.xlarge)

environment

  • aws m3.xlarge x 2 (client, server)
  • para-virtual amazon linux (amzn-ami-pv-2014.03.rc-0.x86_64-ebs)
  • running on docker container image

result

benchmark:
github.com/mathane/echoserver
./client -c50 -o16 -h2000 x 3
@umegaya
umegaya / gist:61a25286a2f016595b61
Created July 17, 2014 11:17
problem with docker container
- docker container vs VirtualBox vm
- significant speed down on multithreading (vm does not have such an speed up (but not effective, through))
- around 1/4 performance than single thread mode
- compared with centos 6.5 vm, slower (but compared with centos 7 vm, its slightly faster)
- all (enough) CPU can be used from both (6CPU for VM, all CPU for container)
-- package.path = ("../ffiex/?.lua;" .. package.path)
local ffi = require 'ffiex'
--ffi.__DEBUG_CDEF__ = true
local util = require 'pulpo.util'
local memory = require 'pulpo.memory'
local thread = require 'pulpo.thread'
thread.initialize({
cdef_cache_dir = './tmp/cdefs'
})
@umegaya
umegaya / gist:1c41d50fd390e10eab9d
Last active August 29, 2015 14:03
pulpo: echoserver performance compare with other languages

on VirtualBox CentOS 6.5 VM (6CPU/1024GB)

result

# ./server_epoll
[iyatomi@microft echoserver]$ ./bench.sh
Throughput: 15860.09 [#/sec]
@umegaya
umegaya / gist:1e3a5856b2a6e750ab00
Last active August 29, 2015 14:03
docker vs virtual box vm
## docker
bash-4.1# luajit test/poller.lua
listen: 4 0.0.0.0:8008
start cdata<struct pulpo_poller *>: 0x006d9560
scscscscscscscscscscscscscscscscscscscsc
end 5.39 sec
bash-4.1# luajit test/poller.lua
listen: 4 0.0.0.0:8008
start cdata<struct pulpo_poller *>: 0x01b1b7f0
scscscscscscscscscscscscscscscscscscscsc
@umegaya
umegaya / gist:ebf5d9a0b27e1b4094b8
Last active August 29, 2015 14:03
luajit : 2.1.0-alpha vs 2.0.3
on macbook pro 2.3Ghz corei7 + 8gb 1600mhz DDR3
dokyoBook:pulpo dokyogames$ luajit-2.1.0-alpha test/poller.lua
listen: 4 0.0.0.0:8008
start cdata<struct pulpo_poller *>: 0x0181f600
scscscscscscscscscscscscscscscscscscscsc
end 1.983931 sec
success
dokyoBook:pulpo dokyogames$ luajit-2.1.0-alpha test/poller.lua
listen: 4 0.0.0.0:8008
@umegaya
umegaya / gist:a635cfa514402df5b4ec
Created June 9, 2014 07:50
when installation with gem fail with -multiply_definedsuppress
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install {gem}