.
D 2010-09-17T22:54:49
J assignee dkf
J cmimetype text/plain
J comment The\s"streq"\sand\s"strcmp"\sinstructions\scould\sbenefit\sfrom\sa\sbit\sof\sunification\s(as\ssuggested\sby\sa\scomment\sin\stclExecute.c).\n\nFor\sexample,\s[string\scompare]\shas\svery\sefficient\sspecial\scases\sfor\sByteArray\sand\sString\soperands,\sthat\s[string\sequal]\slacks.\nAs\sa\sconsequence,\sa\snaive\stest\sof\sequality\son\sbig\sbyte\sarrays\swith\s[string\sequal]\sis\s~7\stimes\sslower\sthan\sthe\sless\sobvious\s[string\scompare],\sdespite\sthe\sfact\sthat\sthe\slatter\sproduces\sa\smore\selaborate\sresult\s(three-valued\sinstead\sof\sbinary):\n\nSource\sthis:\n\n\s\sset\sz\s[open\s/dev/zero\sr]\n\s\sfconfigure\s$z\s-translation\sbinary\n\s\sset\sb1\s[read\s$z\s1000000]\n\s\sset\sb2\s[read\s$z\s1000000]\n\s\sset\sy\s1\n\nThen\sinteractively:\n\n\s\s%\stime\s{string\scompare\s$b1\s$b2}\s1000\n\s\s301.596\smicroseconds\sper\siteration\n\s\s%\stime\s{string\scompare\s$b1\s$b2}\s1000\n\s\s299.637\smicroseconds\sper\siteration\n\s\s%\stime\s{string\scompare\s$b1\s$b2}\s1000\n\s\s298.203\smicroseconds\sper\siteration\n\s\s%\s::tcl::unsupported::representation\s\s$b1\n\s\svalue\sis\sa\sbytearray\swith\sa\srefcount\sof\s2,\sobject\spointer\sat\s0x9b55e50,\sinternal\srepresentation\s0xb69ae010:0x9b56fc0,\sno\sstring\srepresentation.\n\s\s%\s::tcl::unsupported::representation\s\s$b2\n\s\svalue\sis\sa\sbytearray\swith\sa\srefcount\sof\s2,\sobject\spointer\sat\s0x9b56e58,\sinternal\srepresentation\s0xb68ac010:0x9b55e50,\sno\sstring\srepresentation.\n\s\s%\stime\s{string\sequal\s$b1\s$b2}\s1000\n\s\s2159.225\smicroseconds\sper\siteration\n\s\s%\stime\s{string\sequal\s$b1\s$b2}\s1000\n\s\s2128.354\smicroseconds\sper\siteration\n\s\s%\stime\s{string\sequal\s$b1\s$b2}\s1000\n\s\s2129.929\smicroseconds\sper\siteration\n\s\s%\s::tcl::unsupported::representation\s\s$b1\n\s\svalue\sis\sa\sbytearray\swith\sa\srefcount\sof\s2,\sobject\spointer\sat\s0x9b55e50,\sinternal\srepresentation\s0xb69ae010:0x9b56fc0,\sno\sstring\srepresentation.\n\s\s%\s::tcl::unsupported::representation\s\s$b2\n\s\svalue\sis\sa\sbytearray\swith\sa\srefcount\sof\s2,\sobject\spointer\sat\s0x9b56e58,\sinternal\srepresentation\s0xb68ac010:0x9b55e50,\sno\sstring\srepresentation.\n
J foundin None
J is_private 0
J priority 7\sHigh
J resolution None
J status Open
J submitter ferrieux
J subsystem 18.\sCommands\sM-Z
J title Performance\sgap\sbetween\s[string\sequal]\sand\s[string\scompare]
J type Bug
K 3069593fffffffffffffffffffffffffffffffff
U ferrieux
Z 9b5cae1d9087d5c039df445c71b1404b