Skip to content
Tcl Source Code Artifact [84c5a6d30d]
Login

Artifact [84c5a6d30d]

Artifact 84c5a6d30d067b3c369074e9b9aac60d063e2ccf:

Ticket change [84c5a6d30d] - New ticket [1767293fffffffff|1767293fff] <i>Bad performance using ** operator with integer operands</i>. by egavilan on 2007-08-03 19:53:50.
D 2007-08-03T19:53:50
J assignee msofer
J cmimetype text/plain
J comment When\susing\sintegers\swith\s**\soperand,\sthe\sspeed\sis\sconsiderably\sslower\sthan\sif\susing\sat\sleast\sone\sfloat\sargument.\n\nAfter\sa\sfew\sruns,\sI\sget\sconsistenly\sthese\sresults:\n\n%\stime\s{expr\s{5.0**2}}\s10000\n3.6763\smicroseconds\sper\siteration\n%\stime\s{expr\s{5**2.0}}\s10000\n3.6791\smicroseconds\sper\siteration\n%\stime\s{expr\s{double(5)**2}}\s10000\n5.4605\smicroseconds\sper\siteration\n%\stime\s{expr\s{5**double(2)}}\s10000\n5.693\smicroseconds\sper\siteration\n%\stime\s{expr\s{5**2}}\s10000\n38.9746\smicroseconds\sper\siteration\n\njust\sto\scompare\swith\sthe\sother\s"traditional"\sways\sto\sobtain\s5**2\n\n%\stime\s{expr\s{5*5}}\s10000\n2.7841\smicroseconds\sper\siteration\n%\stime\s{expr\s{pow(5,2)}}\s10000\n7.7954\smicroseconds\sper\siteration\n\n%\sinfo\spatchlevel\n8.5a6\n\n
J foundin obsolete:\s8.5a6
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter egavilan
J subsystem 45.\sParsing\sand\sEval
J title Bad\sperformance\susing\s**\soperator\swith\sinteger\soperands
J type Bug
K 1767293fffffffffffffffffffffffffffffffff
U egavilan
Z f23646a5655ef0cdfa10ce335366b3c7