Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Performance regression in the expr in/ni operator in Tcl 9

Closed / Fixed8994c972ad3df0aff53739fce486e39809a7b752Created 267 days agoUpdated 266 days ago
Descriptionmarkdown2026-03-11 14:02:52

Compare 8.6

% timerate -calibrate {}
0.03480732249997189 µs/#-overhead 0.035377 µs/# 55176756 # 28266780 #/sec
% set l [lrepeat 1000 x]; timerate {expr {"a" in $l}}
6.619428 µs/# 150279 # 151070 #/sec 994.761 net-ms

with 9.0

% package req Tcl
9.0.2
% set l [lrepeat 1000 x]; timerate {expr {"a" in $l}}
9.195111 µs/# 108328 # 108753 #/sec 996.088 net-ms
Referenced by3
apnadkarni Ticket [8994c972ad]: 3 changes [History diff]2026-03-11 14:03:10
apnadkarnimarkdown2026-03-11 15:45:53

Proposed fix in 9893f7e1e7.

 timerate -calibrate {}
0.03631045936580007 µs/#-overhead 0.036670 µs/# 53231733 # 27270355 #/sec
% package req Tcl
9.0.4
% set l [lrepeat 1000 x]; timerate {expr {"a" in $l}}
4.169346 µs/# 237791 # 239845 #/sec 991.433 net-ms
apnadkarni Closed ticket [8994c972ad]. [History diff]2026-03-13 02:48:13
Log in (anonymous is fine) to add a comment.