Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
master
Branches (1)
master
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
The license selected for the repository is subject to the license used by the main branch of the repository.
master
Branches (1)
master
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (1)
master
contribute
Sync branch
See difference Through Pull Request Sync
Sync branch
Through Pull Request Sync
A Pull Request will be created to the current
branch and will be merged in to complete the sync
File empty ...
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
stringbench is a set of performance tests comparing byte string
operations with unicode operations. The two string implementations
are loosely based on each other and sometimes the algorithm for one is
faster than the other.
These test set was started at the Need For Speed sprint in Reykjavik
to identify which string methods could be sped up quickly and to
identify obvious places for improvement.
Here is an example of a benchmark
@bench('"Andrew".startswith("A")', 'startswith single character', 1000)
def startswith_single(STR):
 s1 = STR("Andrew")
 s2 = STR("A")
 s1_startswith = s1.startswith
 for x in _RANGE_1000:
 s1_startswith(s2)
The bench decorator takes three parameters. The first is a short
description of how the code works. In most cases this is Python code
snippet. It is not the code which is actually run because the real
code is hand-optimized to focus on the method being tested.
The second parameter is a group title. All benchmarks with the same
group title are listed together. This lets you compare different
implementations of the same algorithm, such as "t in s"
vs. "s.find(t)".
The last is a count. Each benchmark loops over the algorithm either
100 or 1000 times, depending on the algorithm performance. The output
time is the time per benchmark call so the reader needs a way to know
how to scale the performance.
These parameters become function attributes.
Here is an example of the output
========== count newlines
38.54 41.60 92.7 ...text.with.2000.newlines.count("\n") (*100)
========== early match, single character
1.14 1.18 96.8 ("A"*1000).find("A") (*1000)
0.44 0.41 105.6 "A" in "A"*1000 (*1000)
1.15 1.17 98.1 ("A"*1000).index("A") (*1000)
The first column is the run time in milliseconds for byte strings.
The second is the run time for unicode strings. The third is a
percentage; byte time / unicode time. It's the percentage by which
unicode is faster than byte strings.
The last column contains the code snippet and the repeat count for the
internal benchmark loop.
The times are computed with 'timeit.py' which repeats the test more
and more times until the total time takes over 0.2 seconds, returning
the best time for a single iteration.
The final line of the output is the cumulative time for byte and
unicode strings, and the overall performance of unicode relative to
bytes. For example
4079.83 5432.25 75.1 TOTAL
However, this has no meaning as it evenly weights every test.
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linux2014/48_python_study.git
git@gitee.com:linux2014/48_python_study.git
linux2014
48_python_study
48_python_study
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /