- 人々の創造性を最大限引き出し、増幅させる分散コンピューティング環境の開発
- 分散コンピューティングをいままでよりもずっと自由に、簡単に行うことができるプログラミング環境を作ることで、人々の創造性を最大限引き出し、増幅させる
- 現代の創造性の発露はかなりの部分がネットワークを通じたサービスの提供を通じて行われるため
| 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, | |
| }) |
benchmark:
github.com/mathane/echoserver
./client -c50 -o16 -h2000 x 3
| - 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' | |
| }) |
# ./server_epoll
[iyatomi@microft echoserver]$ ./bench.sh
Throughput: 15860.09 [#/sec]| ## 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 |
| 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 |
| sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install {gem} |