Title: Unicode eq operation with hash.
Type: performance Stage: resolved
Components: Unicode Versions: Python 3.7
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: corona10, ezio.melotti, vstinner
Priority: normal Keywords:

Created on 2017-04-18 13:11 by corona10, last changed 2017-04-18 13:19 by corona10. This issue is now closed.

Messages (3)
msg291833 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2017-04-18 13:11
If the Unicode compare operation is done by comparing the hashes, it is likely to be efficient because memory comparison is not necessary.

If this idea is approved I could upload my PR right now. :-)
(I already checked local unit test is passed.)
msg291834 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-18 13:15
My previous attempt which ended with "Raymond Hettinger: I don't think it is worth it."

Most string comparisons are comparisons of strings of less than 20 characters.
msg291835 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2017-04-18 13:19
Thanks for the reply.

I did not know it was already discussed.
The conclusion of the thread looks reasonable.
Date User Action Args
2017-04-18 13:19:44corona10setstatus: open -> closed
stage: resolved
2017-04-18 13:19:31corona10setmessages: + msg291835
2017-04-18 13:15:37vstinnersetmessages: + msg291834
2017-04-18 13:11:45corona10create