This file contains hidden or 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
| --[[ | |
| Environment: iCore7 2620M (2.70GHz), luajit 2.1 | |
| array size: 10 | |
| | pairs | ipairs | indexing | | |
| | 1.000000 | 0.580247 | 0.209877 | | |
| | 1.723404 | 1.000000 | 0.361702 | | |
| | 4.764706 | 2.764706 | 1.000000 | | |
| array size: 100 | |
| | pairs | ipairs | indexing | |
This file contains hidden or 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
| -- Testing coroutine overhead in LuaJIT 2.1 with NPL runtime | |
| --[[ | |
| Starting function test... | |
| memory(KB): 0.35546875 | |
| Functions: 500000 | |
| Elapsed time: 0 s | |
| Starting coroutine test... | |
| memory(KB): 13781.81640625 | |
| Coroutines: 500000 | |
| Elapsed time: 0.191 s |
This file contains hidden or 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
| #!/usr/bin/perl | |
| use DBI; | |
| use Encode; | |
| use utf8; | |
| require "cgilib.pl"; |
This file contains hidden or 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
| #!/usr/bin/perl | |
| use DBI; | |
| use JSON; | |
| use XML::Simple; | |
| use Encode; | |
| use utf8; | |
| binmode(STDOUT, ':encoding(utf8)'); | |
| binmode(STDIN, ':encoding(utf8)'); |
This file contains hidden or 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
| -- generate a random tree | |
| local function random(min_value, max_value) | |
| return min_value + math.random()*(max_value - min_value); | |
| end | |
| function make_tree(level, length, last_radius, leave_size) | |
| last_radius = last_radius or length*0.2; | |
| local radius = last_radius*0.5; | |
| if(level>1) then |