Created
October 16, 2014 01:06
-
-
Save hymkor/253351abeb5080d1f36b to your computer and use it in GitHub Desktop.
[Lua] rawset は別に速くなかった ref: http://qiita.com/zetamatta/items/9c2d70c32cfe47e08abe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::rem:: --[[ vim:set ft=lua: | |
@lua "%~f0" %* & exit /b | |
]]-- | |
t = {} | |
for i=1,100000 do | |
table.insert(t,"x") | |
end | |
print(os.clock()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::rem:: --[[ vim:set ft=lua: | |
@lua "%~f0" %* & exit /b | |
]]-- | |
t = {} | |
for i=1,100000 do | |
t[i] = "x" | |
end | |
print(os.clock()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::rem:: --[[ vim:set ft=lua: | |
@lua "%~f0" %* & exit /b | |
]]-- | |
t = {} | |
for i=1,100000 do | |
rawset(t,i,"x") | |
end | |
print(os.clock()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bench1 | |
0.018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bench2 | |
0.006 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bench3 | |
0.015 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment