Movatterモバイル変換


[0]ホーム

URL:


homepage

Message290781

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Authorserhiy.storchaka
Recipientsazsorkin, louielu, malin, methane, ned.deily, pitrou, python-dev, serhiy.storchaka, vstinner, xiang.zhang
Date2017-03-29.13:32:52
SpamBayes Score-1.0
Marked as misclassifiedYes
Message-id<1490794372.35.0.140395450638.issue24821@psf.upfronthosting.co.za>
In-reply-to
Content
Thank you for testing Louie. Thank you for your review and testing Xiang.> Would it completely kill performances to remove the optimization?Yes. The optimization is not used if the lowest byte is 0. You can try to search "\0" for getting the result without the optimization. On my netbook the optimization speeds up searching by 5.5 times.Search with optimization:$ ./python -m perf timeit -s 's = "АБВГД"*10**5' -- 's.find("Ж")'Median +- std dev: 296 us +- 33 usSearch without optimization:$ ./python -m perf timeit -s 's = "АБВГД"*10**5' -- 's.find("\0")'Median +- std dev: 1.65 ms +- 0.10 msSearch an unlucky character (unpatched):$ ./python -m perf timeit -s 's = "АБВГД"*10**5' -- 's.find("Є")'Median +- std dev: 14.7 ms +- 1.8 msSearch an unlucky character (patched):$ ./python -m perf timeit -s 's = "АБВГД"*10**5' -- 's.find("Є")'Median +- std dev: 2.17 ms +- 0.24 ms
History
DateUserActionArgs
2017-03-29 13:32:52serhiy.storchakasetrecipients: +serhiy.storchaka,pitrou,vstinner,ned.deily,methane,python-dev,malin,azsorkin,xiang.zhang,louielu
2017-03-29 13:32:52serhiy.storchakasetmessageid: <1490794372.35.0.140395450638.issue24821@psf.upfronthosting.co.za>
2017-03-29 13:32:52serhiy.storchakalinkissue24821 messages
2017-03-29 13:32:52serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp