[issue24582] Minor branch optimization in set implementation

2015-07-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks. FWIW, there was one other issue. The code is set-up to accommodate aggressive in-lining so that the code in set_contains(), for example, the sets a return value of -1 gets combined with the downstream test for -1 and the pairs gets folded away in

[issue24582] Minor branch optimization in set implementation

2015-07-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Then feel free to close this issue. I'm not very experienced with modern superscalar CPUs. -- ___ Python tracker ___

[issue24582] Minor branch optimization in set implementation

2015-07-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I had tried some variants of this a one point and saw no benefit at all. -- ___ Python tracker ___

[issue24582] Minor branch optimization in set implementation

2015-07-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I believe this patch will make matters worse. The current pair of tests can essentially be run in parallel and the one with rv==-1 is highly predictable (essentially zero cost). -- priority: normal -> low ___ Py

[issue24582] Minor branch optimization in set implementation

2015-07-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue24582] Minor branch optimization in set implementation

2015-07-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: For now multiple set functions call helpers that returns one of three possible values (0, 1, and -1 for error) and then analyze return code in the loop. while (...) { rv = some_set_operation(); if (rv < 0) { // clean up