3 ms·
That means nothing in isolation. Fill us in.
by bch 6y ago
That means nothing in isolation. Fill us in.
- petre 6y agoIn Tcl everything is a string. If you work with numbers for instance it's quite slow. Or maybe loop or set operations are slow. Dunno. Compare these two: Lua https://p.thorsen.pm/5ecb8ce026ab Tcl https://p.thorsen.pm/ee8a792acd52 Results: Lua 5.2: 0m0,027s LuaJIT 2.1: 0m0,016s Tcl 8.6: 0m0,630s I'd pick Lua over Tcl any day.
- bch 6y agoThanks for the exercise - I got an order of magnitude improvement on Tcl just by bracing the expressions: Bad: expr $i +$j + 2 Good: expr {$i + $j + 2} ... it saves interpretation and evaluation to occurring once, hoisted in the [expr] engine; it’s idiomatic. The lua version still appeared faster, though I’ve only spent 2 minutes looking at this. Again, strings should play no issue here; values must be able to generate a string-representation, but it’s computed lazily, and in this case, the $i, $j, etc in Tcl are working with native integers. I’m happy we have things like Tcl and Lua; either one of them makes development enjoyable. I appreciate you taking time to write your code samples.