summaryrefslogtreecommitdiffstats
path: root/tools/microoptimization/generalbytecode.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/microoptimization/generalbytecode.tcl')
-rw-r--r--tools/microoptimization/generalbytecode.tcl13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/microoptimization/generalbytecode.tcl b/tools/microoptimization/generalbytecode.tcl
new file mode 100644
index 0000000..2471943
--- /dev/null
+++ b/tools/microoptimization/generalbytecode.tcl
@@ -0,0 +1,13 @@
+apply {{{limit1 100} {limit2 1000}} {
+ for {set i 0} {$i < $limit1} {incr i} {
+ apply {limit2 {
+ set a {}
+ set b {}
+ for {set i 0} {$i < $limit2} {incr i} {
+ lappend a $i
+ dict set b $i [expr {$i*$i}]
+ }
+ return [string length $a],[string length $b]
+ }} $limit2
+ }
+}} {*}$argv