PyConChina2022-深圳-大规模生产环境下的Faster CPython-王文洋function calls • PEP 659: Specializing Adaptive Interpreter 动态语言的虚拟机可以根据执行中出现过的类型和值对代码进行特化,以提高运行效率。这种特化通常与 “JIT ”编译 器联系在一起。但即使没有编译成机器代码,这种优化也是有益的。 Execution Quicken Adaptive Instruction Specialization Deopt Deopt def get_url(path): return "https://example.com" + path print(dis.dis(get_url, adaptive=True)) 3 0 RESUME 0 4 2 LOAD_CONST 1 ('https://example.com') 4 LOAD_FAST 4 LOAD_FAST 0 (path) 6 BINARY_OP_ADAPTIVE 0 (+) 10 RETURN_VALUE PEP 659: Specializing Adaptive Interpreter 3 0 RESUME_QUICK 0 4 2 LOAD_CONST__LOAD_FAST0 码力 | 31 页 | 2.47 MB | 1 年前3
Python 标准库参考指南 3.13 executemany("INSERT INTO lang VALUES(:name, :year)", data) # This is the qmark style used in a SELECT query: params = (1972,) cur.execute("SELECT * FROM lang WHERE first_appeared = ?", params) print(cur.fetchall()) If group is not None, the setregid() system call will be made in the child process prior to the execution of the subprocess. If the provided value is a string, it will be looked up via grp.getgrnam() and extra_groups is not None, the setgroups() system call will be made in the child process prior to the execution of the subprocess. Strings provided in extra_groups will be looked up via grp.getgrnam() and the0 码力 | 2246 页 | 11.74 MB | 9 月前3
Python 标准库参考指南 3.13 executemany("INSERT INTO lang VALUES(:name, :year)", data) # This is the qmark style used in a SELECT query: params = (1972,) cur.execute("SELECT * FROM lang WHERE first_appeared = ?", params) print(cur.fetchall()) If group is not None, the setregid() system call will be made in the child process prior to the execution of the subprocess. If the provided value is a string, it will be looked up via grp.getgrnam() and extra_groups is not None, the setgroups() system call will be made in the child process prior to the execution of the subprocess. Strings provided in extra_groups will be looked up via grp.getgrnam() and the0 码力 | 2242 页 | 11.73 MB | 9 月前3
Python 标准库参考指南 3.12 12 Chapter 2. 内置函数 The Python Library Reference, 发行版本 3.12.7 This function supports dynamic execution of Python code. object must be either a string or a code object. If it is a string, the string is executemany("INSERT INTO lang VALUES(:name, :year)", data) # This is the qmark style used in a SELECT query: params = (1972,) cur.execute("SELECT * FROM lang WHERE first_appeared = ?", params) print(cur.fetchall()) If group is not None, the setregid() system call will be made in the child process prior to the execution of the subprocess. If the provided value is a string, it will be looked up via grp.getgrnam() and0 码力 | 2253 页 | 11.81 MB | 9 月前3
Python 标准库参考指南 3.12 12 Chapter 2. 内置函数 The Python Library Reference, 发行版本 3.12.7 This function supports dynamic execution of Python code. object must be either a string or a code object. If it is a string, the string is executemany("INSERT INTO lang VALUES(:name, :year)", data) # This is the qmark style used in a SELECT query: params = (1972,) cur.execute("SELECT * FROM lang WHERE first_appeared = ?", params) print(cur.fetchall()) If group is not None, the setregid() system call will be made in the child process prior to the execution of the subprocess. If the provided value is a string, it will be looked up via grp.getgrnam() and0 码力 | 2253 页 | 11.81 MB | 9 月前3
1_当Python遇上FPGA_PYNQ开源项目的实践与体会_陆佳华MPSoC & RFSoC ACAP First Virtex FPGA Virtex-2 Pro Page 7 Driving Adaptive Computing with Versal The World’s First Adaptive Compute Acceleration Platform Scalar Processing Engines Adaptable Hardware0 码力 | 9 页 | 3.42 MB | 1 年前3
Python 标准库参考指南 3.11.10 progress_handler。 Returning a non-zero value from the handler function will terminate the currently executing query and cause it to raise an OperationalError exception. set_trace_callback(trace_callback) 注册callable executemany("INSERT INTO lang VALUES(:name, :year)", data) # This is the qmark style used in a SELECT query: params = (1972,) cur.execute("SELECT * FROM lang WHERE first_appeared = ?", params) print(cur.fetchall()) 上,可执行文件可能是包含多种架构的通用文件。 To get at the ”64-bitness” of the current interpreter, it is more reliable to query the sys.maxsize attribute: is_64bits = sys.maxsize > 2**32 platform.machine() 返回机器类型,例如 'AMD64'0 码力 | 2248 页 | 11.10 MB | 9 月前3
Python 标准库参考指南 3.11.10 progress_handler。 Returning a non-zero value from the handler function will terminate the currently executing query and cause it to raise an OperationalError exception. set_trace_callback(trace_callback) 注册callable executemany("INSERT INTO lang VALUES(:name, :year)", data) # This is the qmark style used in a SELECT query: params = (1972,) cur.execute("SELECT * FROM lang WHERE first_appeared = ?", params) print(cur.fetchall()) 上,可执行文件可能是包含多种架构的通用文件。 To get at the ”64-bitness” of the current interpreter, it is more reliable to query the sys.maxsize attribute: is_64bits = sys.maxsize > 2**32 platform.machine() 返回机器类型,例如 'AMD64'0 码力 | 2399 页 | 11.19 MB | 9 月前3
PyConChina2022-上海-Python启动加速探索及实践-严懿宸faster-cpython • MS & Guido • Startup performance & runtime performance • Deep-freeze •Specializing Adaptive Interpreter •Inline cache Cinder • Cinder JIT • Lazy import nogil • FAIR Thanks! 感谢观看0 码力 | 21 页 | 3.18 MB | 1 年前3
Python 标准库参考指南 2.7.18 . . . . . . . . . . . . . . . . . . . . . . 1206 26.7 trace —Trace or track Python statement execution . . . . . . . . . . . . . . . . . . . . . . . . . . 1210 27 软件打包和分发 1213 27.1 distutils —构建和安装 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1267 30 Restricted Execution 1269 30.1 rexec —Restricted execution framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1270 不是字符串。如果编译该对象时的 mode 实参是 'exec' 那么eval() 返回值为 None 。 Hints: dynamic execution of statements is supported by the exec statement. Execution of statements from a file is supported by the execfile() function0 码力 | 1552 页 | 7.42 MB | 9 月前3
共 478 条
- 1
- 2
- 3
- 4
- 5
- 6
- 48













