当前位置: 首页 > news >正文

《CPython Internals》阅读笔记:p356-p359

《CPython Internals》学习第 19天,p356-p359 总结,总计 4 页。

一、技术总结

1.benchmark suite

The benchmark suite is the tool to use when comparing the complete performance of Python. The Python Benchmark suite is a collection of Python applications designed to test multiple aspects of the Python runtime under load.

如果按照作者所给的定义“The benchmark suite is the tool to use when comparing the complete performance of Python.”,那么 timeit 也算一个 benchmark suite。但是,timeit 不能算作 benchmark suite,可以算一个 benchmark tool。所以作者给的定义非常不准确。

这里补充一个本人认为更准确的定义:A benchmark suite is a collection of benchmarks(We define a benchmark as a test or set of tests used to compare the performance of alternative tools or techniques.)。

2.pyperformance

pyperformance 是一个 benchmark suite。

(1)安装

pip install pyperformance

(2)配置

[config]
# Path to output json files
json_dir = ~/benchmarks/json# If True, compile CPython is debug mode (LTO and PGO disabled),
# run benchmarks with --debug-single-sample, and disable upload.
#
# Use this option used to quickly test a configuration.
debug = False[scm]
# Directory of CPython source code (Git repository)
repo_dir = ~/cpython# Update the Git repository (git fetch)?
update = False# Name of the Git remote, used to create revision of
# the Git branch. 
git_remote = remotes/origin[compile]
# Create files into bench_dir:
bench_dir = ~/benchmarks/tmp# Link Time Optimization (LTO)?
lto = True# Profiled Guided Optimization (PGO)?
pgo = True# The space-separated list of libraries that are package-only
pkg_only =# Install Python? If false, run Python from the build directory
install = True[run_benchmark]
# Run "sudo python3 -m pyperf system tune" before running benchmarks?
system_tune = True# --benchmarks option for 'pyperformance run'
benchmarks =# --affinity option for 'pyperf system tune' and 'pyperformance run'
affinity =# Upload generated JSON file?
upload = False# Configuration to upload results to a Codespeed website
[upload]
url =
environment =
executable =
project =[compile_all]
# List of CPython Git branches
branches = default 3.6 3.5 2.7# List of revisions to benchmark by compile_all
[compile_all_revisions]
# list of 'sha1=' (default branch: 'master') or 'sha1=branch'
# used by the "pyperformance compile_all" command

(3)执行 benchmark

pyperformance compile -U ~/benchmarks/benchmark.cfg HEAD

二、英语总结(生词:0)

无。

关于英语的注解同步更新汇总到 https://github.com/codists/English-In-CS-Books 仓库。

三、其它

阅读这本书的时候,大部分时间都花在了理解“作者说这些表达的是什么意思?”上面了。

四、参考资料

1. 编程

(1) Anthony Shaw,《CPython Internals》:https://book.douban.com/subject/35405785/

2. 英语

(1) Etymology Dictionary:https://www.etymonline.com

(2) Cambridge Dictionary:https://dictionary.cambridge.org

欢迎搜索及关注:编程人(a_codists)

http://www.lryc.cn/news/526528.html

相关文章:

  • Linux--权限
  • java后端之登录认证
  • 【矩阵二分】力扣378. 有序矩阵中第 K 小的元素
  • C语言-构造数据类型
  • 鸿蒙next 自定义日历组件
  • 【express-generator】08-路由重定向
  • 搭建Spring Boot开发环境
  • Spatial Group-wise Enhance (SGE) module
  • 二叉搜索树中的搜索(力扣700)
  • 记录让cursor帮我给ruoyi-vue后台管理项目整合mybatis-plus
  • 【可实战】Linux 系统扫盲、 Shell扫盲(如何写一个简单的shell脚本)
  • sqlzoo答案4:SELECT within SELECT Tutorial
  • 【fly-iot飞凡物联】(20):2025年总体规划,把物联网整套技术方案和实现并落地,完成项目开发和课程录制。
  • Lucene常用的字段类型lucene检索打分原理
  • 适用于IntelliJ IDEA 2024.1.2部署Tomcat的完整方法,以及笔者踩的坑,避免高血压,保姆级教程
  • XSS靶场通关详解
  • Excel 技巧15 - 在Excel中抠图头像,换背景色(★★)
  • 备忘-humanplus相关的代码解析
  • 青少年编程与数学 02-008 Pyhon语言编程基础 01课题、语言概要
  • XSS (XSS)分类
  • [Linux]el8安全配置faillock:登录失败达阈值自动锁定账户配置
  • 最新-CentOS 7安装1 Panel Linux 服务器运维管理面板
  • selenium定位网页元素
  • 積分方程與簡單的泛函分析8.具連續對稱核的非齊次第II類弗雷德霍姆積分算子方程
  • 长理算法复习
  • 机器学习-K近邻算法
  • 使用rsync+inotify简单实现文件实时双机双向同步
  • Ubuntu 24.04 LTS开机自启动脚本设置方法
  • 谈谈对JavaScript 中的事件冒泡(Event Bubbling)和事件捕获(Event Capturing)的理解
  • 解读2025年生物医药创新技术:展览会与论坛的重要性