diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-05-14 19:58:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-05-14 19:58:50 +0200 |
commit | fd0c4577a4b6e85ca2db664906e1a03807ce133f (patch) | |
tree | fa23fcc04248d03ff82e34634b8ef1bb9cf28acb /doc/context/sources/general/manuals/about/about-jitting-jit.lua | |
parent | db581096187dc2d3cbdbe4cdc39d247c168b1607 (diff) | |
download | context-fd0c4577a4b6e85ca2db664906e1a03807ce133f.tar.gz |
2017-05-14 19:15:00
Diffstat (limited to 'doc/context/sources/general/manuals/about/about-jitting-jit.lua')
-rw-r--r-- | doc/context/sources/general/manuals/about/about-jitting-jit.lua | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/doc/context/sources/general/manuals/about/about-jitting-jit.lua b/doc/context/sources/general/manuals/about/about-jitting-jit.lua new file mode 100644 index 000000000..ec669a253 --- /dev/null +++ b/doc/context/sources/general/manuals/about/about-jitting-jit.lua @@ -0,0 +1,163 @@ +return { + { + ["off"]="0.399", + ["on"]="0.081", + }, + { + ["off"]="1.339", + ["on"]="0.081", + }, + { + ["off"]="4.527", + ["on"]="2.817", + }, + { + ["off"]="0.644", + ["on"]="0.640", + }, + { + ["off"]="3.032", + ["on"]="3.007", + }, + { + ["off"]="4.046", + ["on"]="4.977", + }, + ["local fc = font.current\ +\ +function font.current()\ + return fc()\ +end\ +\ +return function()\ + local a = 0\ + for i=1,10000 do\ + a = a + font.current()\ + end\ +end"]={ + ["off"]="1.966", + ["on"]="2.492", + }, + ["local fc = font.current\ +\ +function font.xcurrent()\ + return fc()\ +end\ +\ +return function()\ + local a = 0\ + for i=1,10000 do\ + a = a + font.xcurrent()\ + end\ +end"]={ + ["off"]="1.912", + ["on"]="1.915", + }, + ["local function whatever(i)\ + return i\ +end\ +\ +return function()\ + local a = 0\ + for i=1,10000 do\ + a = a + whatever(i)\ + end\ +end"]={ + ["off"]="0.648", + ["on"]="0.042", + }, + ["local tostring, tonumber = tostring, tonumber\ +return function()\ + local a = 0\ + for i=1,1000 do\ + local a = a + tonumber(tostring(i))\ + end\ +end"]={ + ["off"]="2.620", + ["on"]="0.162", + }, + ["local tostring, tonumber = tostring, tonumber\ +return function()\ + local a = 0\ + for i=1,10000 do\ + local a = a + tonumber(tostring(i))\ + end\ +end"]={ + ["off"]="79.316", + ["on"]="5.640", + }, + ["return function()\ + local a = 0\ + for i=1,100 do\ + local a = a + tonumber(tostring(i))\ + end\ +end"]={ + ["off"]="0.703", + ["on"]="0.047", + }, + ["return function()\ + local a = 0\ + for i=1,1000 do\ + local a = a + tonumber(tostring(i))\ + end\ +end"]={ + ["off"]="2.607", + ["on"]="0.162", + }, + ["return function()\ + local a = 0\ + for i=1,10000 do\ + a = a + font.current()\ + end\ +end"]={ + ["off"]="1.292", + ["on"]="1.296", + }, + ["return function()\ + local a = 0\ + for i=1,10000 do\ + a = a + i\ + end\ +end"]={ + ["off"]="0.207", + ["on"]="0.042", + }, + ["return function()\ + local a = 0\ + for i=1,10000 do\ + a = a + math.sin(1/i)\ + end\ +end"]={ + ["off"]="2.204", + ["on"]="1.482", + }, + ["return function()\ + local a = 0\ + for i=1,10000 do\ + local a = a + tonumber(tostring(i))\ + end\ +end"]={ + ["off"]="79.456", + ["on"]="5.703", + }, + ["return function()\ + local a = 0\ + local p = (1-lpeg.P(\"5\"))^0 * lpeg.P(\"5\")\ + for i=1,100 do\ + local a = a + (tonumber(lpeg.match(p,tostring(i))) or 0)\ + end\ +end"]={ + ["off"]="0.859", + ["on"]="0.843", + }, + ["return function()\ + local a = 0\ + local p = (1-lpeg.P(\"5\"))^0 * lpeg.P(\"5\") + lpeg.Cc(0)\ + for i=1,100 do\ + local a = a + lpeg.match(p,tostring(i))\ + end\ +end"]={ + ["off"]="0.313", + ["on"]="0.316", + }, +}
\ No newline at end of file |