当前位置:首页>python>继续人肉(非AI)学习PyTorch中Python和C++的接口交互

继续人肉(非AI)学习PyTorch中Python和C++的接口交互

  • 2026-03-12 02:00:13
继续人肉(非AI)学习PyTorch中Python和C++的接口交互
PyTorch 已成为当前人工智能领域最具影响力的深度学习框架之一,在学术研究和工业应用中都占据着重要地位。其以 Python 为主要编程接口,提供灵活直观的模型构建方式,使研究人员能够快速实现和验证新的算法思想;与此同时,PyTorch 的核心计算、算子实现以及自动求导引擎主要依托高性能的 C/C++ 后端完成,从而在保持开发效率的同时保证计算性能与系统扩展能力。正是这种“Python 前端表达 + C/C++ 后端执行”的架构,使 PyTorch 在大规模模型训练、高性能张量计算以及跨硬件平台支持方面表现出强大的能力。因此,深入探索 PyTorch 中 Python 与 C 之间的接口机制,不仅有助于理解其高效执行与灵活编程并存的系统设计思想,也为分析框架内部算子调用流程、性能优化路径以及自定义算子扩展机制奠定了重要基础。
给出PyTorch的小例程:
import torchimport torch.nn as nnimport torch.optim as optim# ----------------------------# 1. Create training data# ----------------------------# Input: [x, y]# Target: z = x^2 + y^3torch.manual_seed(0)X = torch.randn(100002)              # 1000 samples, (x, y)y = X[:, 0]**2 + X[:, 1]**3           # true function

第11行

X[:, 1]**3

最终调用的是C++的函数:

#0  at::native::AVX512::pow_tensor_scalar_optimized_kernel<floatdoubledouble>(at::TensorIteratorBase&, double)::{lambda(float)#2}::operator()(floatconst (__closure=0x7fffffff87be, base=-1.1523602) at /home/zzy/Program/Torch/pytorch/aten/src/ATen/native/cpu/PowKernel.cpp:6767	          return base * base * base;(gdb) list62	        [](Vec base) -> Vec { return base * base; }63	    );64	  } else if (exp == 3.0) {65	    cpu_kernel_vec(iter,66	        [](scalar_t base) -> scalar_t {67	          return base * base * base;68	        },69	        [](Vec base) -> Vec { return base * base * base; }70	    );

这段代码来自 PyTorch 的 CPU pow 算子优化实现PowKernel.cpp),用于处理 张量元素按标量指数求幂 的特殊情况优化。当指数 exp == 3.0 时,代码不会调用通用的 pow() 函数,而是通过 cpu_kernel_vec 注册一个专门的计算内核:对每个输入元素 base 直接计算 base * base * base。这种实现利用简单的乘法替代通用幂函数,可以减少函数调用开销并提高性能。同时,该内核同时提供了 标量版本[](scalar_t base))和 向量化版本[](Vec base)),后者利用 AVX512 等 SIMD 指令一次处理多个数据元素,从而进一步提升 CPU 并行计算效率。上面 gdb 中看到的调用栈正是在执行这个 针对 exp=3 的优化路径中的标量 lambda 函数

在执行链上,有如下调用关系:

Python API (torch.pow / Tensor.pow)        ↓Python wrapper(_handle_torch_function...)        ↓ATen dispatcher        ↓C++ kernel(如 PowKernel.cpp 中的 AVX512 优化实现)

最上层的Python API就是

X[:, 1]**3

最下层的C++ kernel就是上面的C++代码段,而中间的Python wrapper层的实现在pytorch/torch/_tensor.py:

 30  	def _handle_torch_function_and_wrap_type_error_to_not_implemented(f): 31  	    assigned = functools.WRAPPER_ASSIGNMENTS 32   33  	    @functools.wraps(f, assigned=assigned) 34  	    def wrapped(*args, **kwargs): 35  	        try: 36  	            # See https://github.com/pytorch/pytorch/issues/75462 37  	            if has_torch_function(args): 38  	                return handle_torch_function(wrapped, args, *args, **kwargs) 39  	            return f(*args, **kwargs) 40  	        except TypeError: 41  	            return NotImplemented 42  	 43  	    return wrapped

这段代码的作用可以简单理解为:在调用 PyTorch 算子之前做一次“检查和转发”。它会先看看传入的参数里有没有实现了 __torch_function__ 的特殊 Tensor 类型,如果有,就把算子的执行交给这个自定义类型来处理;如果没有,就按正常流程调用原来的函数继续执行。如果过程中出现类型不匹配的错误,它会返回 NotImplemented,让 Python 继续尝试其他可能的实现。换句话说,它是 PyTorch 在 Python 层实现算子可扩展和类型兼容的一道“分发入口”。

这段语句是如何实现的呢?

我首先修改_tensor.py以便调试

--- a/torch/_tensor.py+++ b/torch/_tensor.py@@ -7,7 +7,7 @@ from collections import OrderedDict from copy import deepcopy from numbers import Number from typing import Any, Callable, cast, Optional, Union-+import pdb import torch import torch._C as _C from torch._namedtensor_internals import (@@ -29,7 +29,7 @@ from torch.overrides import ( def _handle_torch_function_and_wrap_type_error_to_not_implemented(f):     assigned = functools.WRAPPER_ASSIGNMENTS-+    pdb.set_trace()     @functools.wraps(f, assigned=assigned)     def wrapped(*args, **kwargs):         try:

然后我在gdb中运行python

gdb Python-3.13.2/build/python (gdb) r -B ./learn1.py

运行过程中,会首先触及pdb的断点:

  /home/zzy/Program/Torch/pytorch/torch/_tensor.py(102)<module>()-> class Tensor(torch._C.TensorBase):  /home/zzy/Program/Torch/pytorch/torch/_tensor.py(1096)Tensor()-> @_handle_torch_function_and_wrap_type_error_to_not_implemented> /home/zzy/Program/Torch/pytorch/torch/_tensor.py(32)_handle_torch_function_and_wrap_type_error_to_not_implemented()-> pdb.set_trace()

这段信息的意思是:在 PyTorch 中定义 Tensor 类的方法时,这些方法被装饰器 _handle_torch_function_and_wrap_type_error_to_not_implemented 修饰。装饰器的作用是在方法真正执行之前先进行一层包装处理:当调用该方法时,实际上会先进入装饰器生成的 wrapped 函数,由它先检查参数中是否存在需要通过 __torch_function__ 机制接管算子的特殊对象,如果有就把执行权转交给它,否则再调用原始的方法实现。因此,这里的调用关系体现的是 Python 装饰器机制:方法调用先经过装饰器包装的函数,再决定是否执行原始函数

gdb中执行Ctrl+C来看以上机制背后的C/C++级别的翻译过程:

#9  0x000055555569eb33 in PyOS_Readline (sys_stdin=0x7ffff7e038e0 <_IO_2_1_stdin_>, sys_stdout=0x7ffff7e045c0 <_IO_2_1_stdout_>,     prompt=prompt@entry=0x7fffd49a0160 "(Pdb) ") at ../Parser/myreadline.c:412#10 0x00005555557ec4b6 in builtin_input_impl (module=module@entry=0x7ffff7ba6930, prompt=0x7fffd493e200) at ../Python/bltinmodule.c:2311#11 0x00005555557ec73c in builtin_input (module=0x7ffff7ba6930, args=args@entry=0x7ffff7fb2ca8, nargs=nargs@entry=1)    at ../Python/clinic/bltinmodule.c.h:1014#12 0x0000555555712b7e in cfunction_vectorcall_FASTCALL (func=0x7ffff7ba7290, args=0x7ffff7fb2ca8, nargsf=<optimized out>, kwnames=<optimized out>)    at ../Objects/methodobject.c:425#13 0x00005555556bc1bb in _PyObject_VectorcallTstate (tstate=0x555555bd5cc0 <_PyRuntime+299040>, callable=0x7ffff7ba7290, args=0x7ffff7fb2ca8    nargsf=9223372036854775809, kwnames=0x0) at ../Include/internal/pycore_call.h:168#14 0x00005555556bc297 in PyObject_Vectorcall (callable=<optimized out>, args=<optimized out>, nargsf=<optimized out>, kwnames=<optimized out>)    at ../Objects/call.c:327#15 0x00005555557f453b in _PyEval_EvalFrameDefault (tstate=0x555555bd5cc0 <_PyRuntime+299040>, frame=0x7ffff7fb2c20, throwflag=0)    at ../Python/generated_cases.c.h:813#16 0x0000555555817276 in _PyEval_EvalFrame (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>)    at ../Include/internal/pycore_ceval.h:119#17 0x0000555555812674 in _PyEval_Vector (tstate=0x555555bd5cc0 <_PyRuntime+299040>, func=0x7fffd49b9310, locals=0x0, args=0x7fffffff14c0, argcount=4--Type <RETfor more, q to quit, c to continue without paging--    kwnames=0x0) at ../Python/ceval.c:1814#18 0x00005555556bbe52 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>, kwnames=<optimized out>)    at ../Objects/call.c:413#19 0x00005555556befea in _PyObject_VectorcallTstate (tstate=tstate@entry=0x555555bd5cc0 <_PyRuntime+299040>, callable=callable@entry=0x7fffd49b9310    args=args@entry=0x7fffffff14c0, nargsf=nargsf@entry=4, kwnames=kwnames@entry=0x0) at ../Include/internal/pycore_call.h:168#20 0x00005555556bf162 in method_vectorcall (method=<optimized out>, args=0x7fffffff1570, nargsf=<optimized out>, kwnames=0x0)    at ../Objects/classobject.c:92#21 0x00005555558a644d in _PyObject_VectorcallTstate (tstate=0x555555bd5cc0 <_PyRuntime+299040>, callable=0x7fffd49599d0    args=args@entry=0x7fffffff1570, nargsf=nargsf@entry=3, kwnames=kwnames@entry=0x0) at ../Include/internal/pycore_call.h:168#22 0x00005555558a6927 in call_trampoline (tstate=tstate@entry=0x555555bd5cc0 <_PyRuntime+299040>, callback=<optimized out>,     frame=frame@entry=0x7fffd4a665d0, what=<optimized out>, arg=<optimized out>) at ../Python/sysmodule.c:1028#23 0x00005555558a7e34 in trace_trampoline (self=<optimized out>, frame=0x7fffd4a665d0, what=<optimized out>, arg=<optimized out>)    at ../Python/sysmodule.c:1064#24 0x0000555555878d7f in sys_trace_instruction_func (self=0x7fffd4abbbc0, args=<optimized out>, nargsf=<optimized out>, kwnames=0x0)    at ../Python/legacy_tracing.c:297#25 0x000055555587187d in _PyObject_VectorcallTstate (tstate=tstate@entry=0x555555bd5cc0 <_PyRuntime+299040>, callable=0x7fffd4abbbc0    args=args@entry=0x7fffffff1678, nargsf=nargsf@entry=9223372036854775810, kwnames=kwnames@entry=0x0) at ../Include/internal/pycore_call.h:168#26 0x0000555555871b19 in call_one_instrument (interp=interp@entry=0x555555ba6470 <_PyRuntime+104400>,     tstate=tstate@entry=0x555555bd5cc0 <_PyRuntime+299040>, args=args@entry=0x7fffffff1678, nargsf=nargsf@entry=9223372036854775810    tool=<optimized out>, event=event@entry=6) at ../Python/instrumentation.c:907#27 0x0000555555874836 in _Py_call_instrumentation_instruction (tstate=0x555555bd5cc0 <_PyRuntime+299040>, frame=<optimized out>, instr=<optimized out>)    at ../Python/instrumentation.c:1372#28 0x0000555555800a04 in _PyEval_EvalFrameDefault (tstate=0x555555bd5cc0 <_PyRuntime+299040>, frame=0x7ffff7fb28f8, throwflag=0)    at ../Python/generated_cases.c.h:3332#29 0x0000555555817276 in _PyEval_EvalFrame (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>)    at ../Include/internal/pycore_ceval.h:119#30 0x0000555555812674 in _PyEval_Vector (tstate=0x555555bd5cc0 <_PyRuntime+299040>, func=0x7fffd4844d10, locals=0x7fffd4968ad0, args=0x0, argcount=0    kwnames=0x0) at ../Python/ceval.c:1814#31 0x00005555557ee369 in builtin___build_class__ (self=<optimized out>, args=args@entry=0x7ffff7fb27e0, nargs=nargs@entry=3, kwnames=kwnames@entry=0x0)    at ../Python/bltinmodule.c:202
(gdb) f 31#31 0x00005555557ee369 inbuiltin___build_class__ (self=<optimized out>, args=args@entry=0x7ffff7fb27e0, nargs=nargs@entry=3, kwnames=kwnames@entry=0x0)    at ../Python/bltinmodule.c:202202	    cell = _PyEval_Vector(tstate, (PyFunctionObject *)func, ns, NULL, 0, NULL);(gdb) p name$2 = (PyObject *) 0x7ffff77f5490(gdb) p (char *)((void *)name + 0x28)$3 = 0x7ffff77f54b8 "Tensor"

这段 gdb 信息的意思是:Python 解释器正在执行 class Tensor(...) 这条类定义语句,并通过内置函数 __build_class__ 来创建这个类对象

追溯Python解释器对以上语句的编译过程:

#31 0x00005555557ee369 in builtin___build_class__ (self=<optimized out>, args=args@entry=0x7ffff7fb27e0, nargs=nargs@entry=3, kwnames=kwnames@entry=0x0)    at ../Python/bltinmodule.c:202202	    cell = _PyEval_Vector(tstate, (PyFunctionObject *)func, ns, NULL0NULL);(gdb) b 202Breakpoint 1 at 0x5555557ee34d: file ../Python/bltinmodule.c, line 202.(gdb) p name$4 = (PyObject *0x7ffff77f5490(gdb) condition 1 name==0x7ffff77f5490
(gdb) x/10gx  frame->instr_ptr0x555559413cb8:	0x0172005c0095005e	0x03720153027200530x555559413cc8:	0x0253055c045c0025	0x001a0353001100270x555559413cd8:	0x0772001a04530672	0x06530872001a05530x555559413ce8:	0x001a07530972001a	0x0b72001a08530a720x555559413cf8:	0x0a530c72001a0953	0x001a0c53012e0b53(gdb) watch *(unsigned long *)0x555559413cb8Hardware watchpoint 2: *(unsigned long *)0x555559413cb8(gdb) condition 2 *(unsigned long *)0x555559413cb8==0x0172005c0095005e

我来到了

(gdb) bt

#0  __memcpy_evex_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:505#1  0x00005555556c14ba in memcpy (__len=1424, __src=<optimized out>, __dest=0x555559413cb8) at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29#2  init_code (co=co@entry=0x555559413bf0, con=con@entry=0x7fffffff4cf0) at ../Objects/codeobject.c:524#3  0x00005555556c25ba in _PyCode_New (con=con@entry=0x7fffffff4cf0) at ../Objects/codeobject.c:688#4  0x00005555557e04a1 in makecode (umd=umd@entry=0x555559298b88, a=a@entry=0x7fffffff4dd0, const_cache=const_cache@entry=0x7fffd4b7c110,     constslist=constslist@entry=0x7fffd4995630, maxdepth=maxdepth@entry=22, nlocalsplus=nlocalsplus@entry=1, code_flags=0, filename=0x7fffd4b53a40)    at ../Python/assemble.c:623#5  0x00005555557e0698 in _PyAssemble_MakeCodeObject (umd=0x555559298b88, const_cache=0x7fffd4b7c110, consts=0x7fffd4995630, maxdepth=22    instrs=0x7fffffff4ec0, nlocalsplus=1, code_flags=0, filename=0x7fffd4b53a40) at ../Python/assemble.c:754#6  0x000055555583cbd7 in optimize_and_assemble_code_unit (u=0x555559298810, const_cache=0x7fffd4b7c110, code_flags=0, filename=0x7fffd4b53a40)    at ../Python/compile.c:7678#7  0x000055555583ccae in optimize_and_assemble (c=0x7fffd4aed740, addNone=1) at ../Python/compile.c:7705#8  0x0000555555822372 in compiler_class_body (c=0x7fffd4aed740, s=0x5555594843a8, firstlineno=102) at ../Python/compile.c:2606#9  0x0000555555822770 in compiler_class (c=0x7fffd4aed740, s=0x5555594843a8) at ../Python/compile.c:2668#10 0x000055555582a81b in compiler_visit_stmt (c=0x7fffd4aed740, s=0x5555594843a8) at ../Python/compile.c:4047

这段调用栈表示:Python 解释器正在把 class Tensor 的类体代码编译成可执行的 Python 字节码(code object)。具体过程可以通俗理解为:当解释器读到 class Tensor(...) 这样的类定义时,并不会直接执行,而是先经过 编译阶段。在这个阶段,解释器会把类体里的 Python 代码(例如方法定义、装饰器等)转换成内部的 code object。调用栈里 compiler_class_body → optimize_and_assemble → makecode → _PyCode_New → init_code → memcpy 就是这个过程的实现路径:编译器先生成指令,再组装成 code object,最后通过 memcpy 把字节码等数据拷贝到新创建的代码对象里。因此,这段栈信息说明 Python 解释器此时正处于类定义的编译阶段,正在为 Tensor 类生成对应的字节码结构,而还没有真正开始执行类中的方法逻辑。

来到第10个调用栈

#10 0x000055555582a81b in compiler_visit_stmt (c=0x7fffd4aed740, s=0x5555594843a8) at ../Python/compile.c:40474047	        return compiler_class(c, s);(gdb) p (char *)((void *)s->v.FunctionDef.name + 0x28)$17 = 0x7ffff77f54b8 "Tensor"(gdb) p s->lineno$18 = 102(gdb) p s->end_lineno$19 = 1783

这段信息说明 Python 编译器正在处理源码中的 Tensor 类定义。在 compiler_visit_stmt 函数中,解释器发现当前语句是一个类定义,于是调用 compiler_class 来编译这个类。打印出的 s->v.FunctionDef.name 显示当前处理的类名是 "Tensor",而 s->lineno = 102s->end_lineno = 1783 表明这个类在源文件中从 第 102 行开始一直到第 1783 行结束。通俗来说,就是 Python 解释器正在把 class Tensor(...) 这一大段类代码编译成内部的字节码结构,为后续创建 Tensor 类对象做准备。

Anthropic CEO Dario Amodei 指出,在人工智能快速发展的时代,人类的判断力与价值决策能力仍然不可替代。随着 AI 能自动完成越来越多技术性任务,人类的核心价值将更多体现在批判性思维、伦理判断以及对 AI 行为的监督上。在一个“AI 可以生成几乎任何内容”的世界里,基本的批判性思维和判断能力可能成为最重要的能力之一[1]

我认为坚持学习是人类保持判断力的重要手段!

[1] https://www.justearthnews.com/economy-details/1100/coding-at-risk-anthropic-ceo-dario-amodei-says-human-centric-roles-may-last-longer.html

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 19:57:00 HTTP/2.0 GET : https://f.mffb.com.cn/a/479343.html
  2. 运行时间 : 0.086804s [ 吞吐率:11.52req/s ] 内存消耗:4,843.62kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=dbf80554de068bb21879fe749abbc277
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000484s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000729s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000362s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000350s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000491s ]
  6. SELECT * FROM `set` [ RunTime:0.000190s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000524s ]
  8. SELECT * FROM `article` WHERE `id` = 479343 LIMIT 1 [ RunTime:0.000438s ]
  9. UPDATE `article` SET `lasttime` = 1774612620 WHERE `id` = 479343 [ RunTime:0.005790s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000266s ]
  11. SELECT * FROM `article` WHERE `id` < 479343 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000407s ]
  12. SELECT * FROM `article` WHERE `id` > 479343 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001407s ]
  13. SELECT * FROM `article` WHERE `id` < 479343 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001396s ]
  14. SELECT * FROM `article` WHERE `id` < 479343 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000803s ]
  15. SELECT * FROM `article` WHERE `id` < 479343 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001964s ]
0.089307s