# Do we still need \`Tools/{io,cc,string}bench\`?

**URL:** <https://discuss.python.org/t/do-we-still-need-tools-io-cc-string-bench/22557>\
**Category:** Core Development\
**Created:** [January 8, 2023, 8:12am UTC](https://discuss.python.org/t/do-we-still-need-tools-io-cc-string-bench/22557 "2023-01-08T08:12:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sobolevn](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sobolevn/32/9274_2.png) [@sobolevn](https://discuss.python.org/u/sobolevn)\
**Post date:** [January 8, 2023, 8:12am UTC](https://discuss.python.org/t/do-we-still-need-tools-io-cc-string-bench/22557/1 "2023-01-08T08:12:30Z")

</div>

There are `Tools` that look quite unused:

1. [cpython/Tools/iobench at main · python/cpython · GitHub](https://github.com/python/cpython/blame/main/Tools/iobench)
2. [cpython/Tools/stringbench at main · python/cpython · GitHub](https://github.com/python/cpython/tree/main/Tools/stringbench) original issue: [Issue 13165: Integrate stringbench in the Tools directory - Python tracker](https://bugs.python.org/issue13165)
3. [cpython/ccbench.py at main · python/cpython · GitHub](https://github.com/python/cpython/blob/main/Tools/ccbench/ccbench.py)

They still claim to support python2 and haven’t been touched for over a decade (except some minor global refactorings like [https://github.com/python/cpython/commit/8f943ca25732d548cf9f0b0393ba8d582fb93e29](https://github.com/python/cpython/commit/8f943ca25732d548cf9f0b0393ba8d582fb93e29))

So, the question is: do we still need them? Aren’t these cases covered by [GitHub - python/pyperformance: Python Performance Benchmark Suite](https://github.com/python/pyperformance) ? Are they required for `faster-cpython` project?

I see several ways forward:

1. Do nothing, they are good as-is
2. Modernize them to be fully useful inside `Tools/`: add new feaftures to the test (like new `str` methods), improve their docs, maybe mention them in [`devguide`](https://devguide.python.org/search/?q=stringbench&check_keywords=yes&area=default)
3. Move them to `pyperformance` suite if needed and delete them from `Tools/`
4. Just delete them - they are outdated (I doubt that)

CC @pitrou @vstinner @storchaka who worked on them initially.

---

<div class="post-metadata">

**Author:** ![sobolevn](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sobolevn/32/9274_2.png) [@sobolevn](https://discuss.python.org/u/sobolevn)\
**Post date:** [January 8, 2023, 8:59am UTC](https://discuss.python.org/t/do-we-still-need-tools-io-cc-string-bench/22557/2 "2023-01-08T08:59:14Z")

</div>

Existing discussion in cpython: [Move Benchmarks From Tools/ to the pyperformance Repo · Issue #97680 · python/cpython · GitHub](https://github.com/python/cpython/issues/97680)

---

<div class="post-metadata">

**Author:** ![gpshead](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/gpshead/32/54_2.png) [@gpshead](https://discuss.python.org/u/gpshead)\
**Post date:** [January 9, 2023, 10:17pm UTC](https://discuss.python.org/t/do-we-still-need-tools-io-cc-string-bench/22557/3 "2023-01-09T22:17:57Z")

</div>

I’m in favor of just deleting them. They’re in version control, if another repo (pyperformance is a good example) wants to adopt any of them for any particular purpose they’ll always exist there.

---

<div class="post-metadata">

**Author:** ![hugovk](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hugovk/32/14505_2.png) [@hugovk](https://discuss.python.org/u/hugovk)\
**Post date:** [February 12, 2023, 6:00pm UTC](https://discuss.python.org/t/do-we-still-need-tools-io-cc-string-bench/22557/4 "2023-02-12T18:00:52Z")

</div>

Please see PR [#101853](https://github.com/python/cpython/pull/101853) to remove them.

---

<div class="post-metadata">

**Author:** ![pitrou](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pitrou/32/28_2.png) [@pitrou](https://discuss.python.org/u/pitrou)\
**Post date:** [February 14, 2023, 7:42pm UTC](https://discuss.python.org/t/do-we-still-need-tools-io-cc-string-bench/22557/5 "2023-02-14T19:42:34Z")

</div>

Some context:

- iobench was developed (by me) when we rewrote the Python 3 IO stack in C
- ccbench was developed (by me) when I [rewrote](https://mail.python.org/pipermail/python-dev/2009-October/093321.html) the GIL implementation

None of them are of course necessary to keep, though the maintenance cost must be close to zero.

---

<div class="post-metadata">

**Author:** ![Sophist-UK](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@Sophist-UK](https://discuss.python.org/u/Sophist-UK)\
**Post date:** [February 18, 2024, 3:20pm UTC](https://discuss.python.org/t/do-we-still-need-tools-io-cc-string-bench/22557/6 "2024-02-18T15:20:54Z")

</div>

I would have commented sooner had I known that this was about to happen. It would have been helpful if someone had commented in [my PR to `ccbench.py`](https://github.com/python/cpython/pull/32135) that this was being considered so that I would have been notified and might have had a chance to comment before it happened.

I believe it was clear from the [extensive discussion about the shortcomings of the current GIL in faster-cpython](https://github.com/faster-cpython/ideas/discussions/328) that the `ccbench` script is still useful - because it clearly identifies an ongoing performance issue when multithreading with one or more CPU-heavy threads.

That said, I do understand that performance scripts do not really have a place in the cpython source code repo, but unfortunately I do not have the time to rework the updated `ccbench` script for the pyperformance suite, so I guess it is going to just disappear.
