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

news/2025/3/11 9:28:49/文章来源:https://www.cnblogs.com/codists/p/18691378

《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.hqwc.cn/news/875754.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

昆工昆明理工大学材料25调剂名额

--材测材料物理与化学材料学材料表征与分析材料工程F001现代材料测试技术F002材料成型技术基础864材料科学基础

@FeignClient中configuration属性的简单介绍

第一个控制请求的日志打印级别 先看效果图 日志级别配置方式新增类 public class FeignConfig {/*** NONE【性能最佳,适用于生产】:不记录任何日志(默认值)* BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间* HEADERS:记录BASIC级别的基…

【MySQL】Mysql 加锁机制与死锁分析

一、锁的分类1.1 锁模式1.2 锁粒度1.2.1 全局锁1.2.2 表级锁1.2.3 页级锁1.2.4 行锁1.3 锁范围1.3.1 记录锁1.3.2 间隙锁(Gap)1.3.3 临键锁1.3.4 意向锁(IS、IX)1.4 兼容性二、加锁机制2.1 加锁规则2.2 加锁分析2.2.1 无索引等值查询2.2.2 无索引范围查询2.2.3 无索引未命中…

Linux上安装DVWA,小白也能上手

dvwa是什么? dvwa全称是Damn Vulnerable Web Application,自己翻译吧。 它是一款非常实用的Web应用安全学习和测试平台。那我就在linux上安装下看看。 对了,我这里的linux是centos 7。 首先,dvwa需要什么? 1、数据库:mysql 2、web服务器:我这里选的是apache,而且php还要…

关于pushup与pushdown的几种常见情况

适用于线段树、平衡树等树形结构。 一.区间修改,区间求和(求最值) 二.最大连续子序列 这里有一种类似于 \(DP\) 的方法。 对于一个节点 \(Rt\),我们需要维护四个值。\(sum\) : 此区间的总和。 \(lmx\) : 此区间从左边开头的最大连续子序列。 \(rmx\) : 此区间从右边开头的最…

美团门票度假商家新订单短信微信邮件提醒

美团门票度假商家新订单目前没有短信微信邮件提醒功能,因此就开发了一个售卖

TextMeshPro系列 —— TextMeshPro (UGUI)

TextMeshPro (UGUI) 默认情况下,TextMesh Pro UI Text 游戏对象包含以下组件:Rect Transform:控制游戏对象在画布上的位置和大小。 Canvas Renderer:在画布上渲染游戏对象。 TextMesh Pro UGUI:包含要显示的文本,以及控制其外观和行为的属性。 Material:一个 Unity 材质…

【运维】运维自动化:工程师的“终结者”还是“助推器”?

一、 运维自动化来袭,行业震荡初现 在当今数字化浪潮中,运维自动化的迅猛发展正深刻变革着整个行业。从简单脚本执行到复杂系统智能管控,自动化工具与技术如雨后春笋般涌现,正重塑着运维工作的格局。 众多企业已大规模引入自动化运维体系,借助 Ansible、Puppet 等工具实现…

cyi启航杯wp

💩杯web Easy_include我用data伪协议 ?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgZmxhZy5waHAnKTs=然后看源代码就有了QHCTF{008110b0-0ea4-4ff3-b02e-bd9e74f1be44}Web_IP flag.php有 Your IP is : xxx.... 原本以为X-Forwarded-For就行,后面发现X-Forwarde…

desmos指北

官方网站 还在学\(OI\)的可以关闭了,给\(whk\)的同学看的 你可能需要了解一些\(LaTeX\),以及数学知识 下标_如\(a_1\),上标^,如\(a^b\) 功能举例具体教程(其实没啥用,官网给的很详细) 试用案例 ✍️ 用 Desmos 3D 制作正方体,相关命令记录; 法1:在输入栏依次手动输入,不…

从理论到实践:Scrum Master(CSM)课程助你成为敏捷引领者

Scrum Master(CSM)在敏捷开发的广阔天地里,Scrum作为最具影响力的框架之一,帮助团队提升协作效率和交付速度。而作为Scrum团队的核心人物,Scrum Master(CSM)无疑是敏捷成功的关键推动者。获得CSM认证,意味着不仅了解Scrum框架,更能有效领导团队走向更高效的工作方式。…

Chat2DB:一款开源的智能数据库查询工具

Chat2DB是一款AI first的数据管理、开发、分析工具,可以将自然语言转换为SQL,也可以将SQL转换为自然语言。 https://chat2db-ai.com/ 以下文章来源于小华同学ai ,作者小华 Chat2DB是一款开源的智能数据库查询工具,旨在帮助开发者更高效地与数据库进行交互。通过自然语言处理…