.
D 2001-10-18T21:50:33
J assignee msofer
J cmimetype text/plain
J comment Tcl_GetBooleanFromObj\s(and\sSetBooleanFromAny)\shave\sthe\sanomaly\sthat\sthey\sdon't\scheck\sfor\san\s\nobject\sthat\sis\salready\sof\sthe\scorrect\stype:\sinstead,\sthey\sreparse\sstrings\son\seach\strip\sthrough.\n\nMoreover,\sthey\scould\sbe\ssped\sup\sstill\sfurther\sby\shaving\sTcl_GetBooleanFromObj\srecognize\sat\sleast\s\ntclIntType\sand\stclLongType,\sand\sdoing\sthe\sobvious\sint-to-Boolean\sconversion.\n\nCode\sthat\sshows\sthe\sperformance\sanomaly:\n\n%\stime\s{\sset\si\s100000\s;\swhile\s{\strue\s&&\s[incr\si\s-1]\s>\s0\s}\s{}\s}\n392272\smicroseconds\sper\siteration\n%\stime\s{\sset\si\s100000\s;\swhile\s{\s1\s\s\s\s&&\s[incr\si\s-1]\s>\s0\s}\s{}\s}\n293493\smicroseconds\sper\siteration
J foundin obsolete:\s8.4a4
J priority 1\sZero
J resolution None
J status Open
J submitter kennykb
J subsystem 10.\sObjects
J title Tcl_GetBooleanFromObject\sperformance
J type Bug
K 472576ffffffffffffffffffffffffffffffffff
U kennykb
Z 8c7f62f1205eff85c630630e752f7c67