当前位置:首页>python>等了20多年!Python终于解决GIL痛点,自由线程手把手教程来了

等了20多年!Python终于解决GIL痛点,自由线程手把手教程来了

  • 2026-06-30 21:58:15
等了20多年!Python终于解决GIL痛点,自由线程手把手教程来了

GIL 正式宣判"缓刑":Python 自由线程来了

2023年9月,Python 官方邮件组里,一封邮件炸了锅。

邮件内容:PEP 703——提议让 Python 的 GIL(全局解释器锁)变成可选项

发件人:Sam Gross,一个来自 Meta 的工程师。

这封邮件的评论区,在 48 小时内涌入了上千条讨论。有人欢呼"Python 性能革命来了",有人担忧"NumPy 和 C 扩展生态会崩溃",还有人说"这是 Guido 退休后 Python 最重要的决定"。

一年半后,Python 3.14 正式将自由线程(Free-Threaded)Python纳入官方支持。

这不是演习。这是 Python 诞生 30 多年来最大的一次底层变革。

GIL 是什么?为什么全世界的 Python 程序员都在"恨"它?

一个故事帮你理解 GIL

想象一下,你开了一家餐厅。厨房里只有一把大勺——不管有多少厨师,大家都得排队用这把勺子来炒菜。
一个厨师在翻炒的时候,另一个厨师只能干等着。就算厨房里有 8 个灶台、16 把锅,对不起,一次只能用一把勺子。
这把"大勺",就是 Python 的 GIL(Global Interpreter Lock,全局解释器锁)。

GIL 的工作原理

GIL 是 CPython 解释器内部的一把"锁"。它的规则很简单:
同一时刻,只有一个线程在执行 Python 字节码。
import threadingimport timedef cpu_task(n, name): """模拟 CPU 密集型计算""" start = time.perf_counter() result = sum(i * i for i in range(n)) elapsed = time.perf_counter() - start print(f"{name} 完成,耗时 {elapsed:.2f}s,结果: {result}")单线程基准print("=== 单线程 ===")start = time.perf_counter()cpu_task(10_000_000"线程A")single_time = time.perf_counter() - startprint(f"总耗时: {single_time:.2f}s\n")# 多线程测试print("=== 4线程 ===")threads = []start = time.perf_counter()for i in range(4): t = threading.Thread(target=cpu_task, args=(10_000_000f"线程{i}")) threads.append(t) t.start()for t in threads: t.join()multi_time = time.perf_counter() - startprint(f"总耗时: {multi_time:.2f}s\n")print(f"加速比: {single_time/multi_time:.2f}x")# 输出:加速比 ≈ 1.0x(几乎没有加速!)
在这个例子中,4 个线程并没有带来 4 倍的性能提升——因为 GIL 只允许一个线程执行 Python 代码。多线程的 Python 程序,在 CPU 密集型任务上,和单线程几乎一样慢。
这就是 Python 的"性能原罪"。全世界有数百万 Python 程序员,每天都在忍受这个限制。

GIL 的历史:当年为什么要加它?

等等,Guido 大叔当年为什么要加 GIL?难道不知道它会限制性能吗?
知道。但 GIL 有它的合理性。
GIL 大大简化了 CPython 的实现。Python 的对象系统是引用计数的,而引用计数在多线程环境下有严重的竞态条件(race condition)。没有 GIL,两个线程同时修改同一个对象的引用计数,可能导致内存泄漏或重复释放。
GIL 把这个复杂的并发问题,用最简单的方式解决了:一次只允许一个线程执行。不需要复杂的锁机制,不需要担心引用计数的竞态问题。Python 的 C 扩展也可以非常简单地与解释器交互。
代价就是:多线程无法真正并行执行 Python 代码。

PEP 703:让 GIL 变成可选项

2023年,Sam Gross 在 Meta 内部开发了一个"去 GIL"的 Python 分支(nogil),并在 PEP 703 中正式提交给 Python 官方。
核心思路:per-object GIL
GIL 的问题是"全局一把锁"。PEP 703 的解决思路是:把锁从"全局"变成"对象级别"
在自由线程的 Python 中:
每个对象都有自己的锁(微锁,fine-grained lock)
引用计数的修改通过原子操作或锁保护
不同线程可以同时执行不同的 Python 代码,只要它们操作的是不同的对象
Python 3.14 自由线程模式下的多线程import threadingimport timedef parallel_compute(start, end, results, index): """每个线程处理自己独立的数据,互不干扰""" total = 0 for i in range(start, end): total += i * i results[index] = total# 4 个独立的数据块N = 10_000_000chunk_size = N // 4results = [0] * 4threads = []start = time.perf_counter()for i in range(4): t = threading.Thread( target=parallel_compute, args=(i * chunk_size, (i + 1) * chunk_size, results, i) ) threads.append(t) t.start()for t in threads: t.join()total_time = time.perf_counter() - startprint(f"总耗时: {total_time:.2f}s")print(f"结果: {sum(results)}")# 在自由线程模式下,这个多线程程序应该接近 4x 加速!

移除 GIL 的代价

天下没有免费的午餐。移除 GIL 也有一些代价:
1. 单线程性能略有下降(2-5%)
自由线程的 Python 需要用锁来保护引用计数。这带来了一些额外的开销。对于纯单线程程序,Python 3.14 自由线程版本比传统版本慢 2-5%。
2. C 扩展需要重新适配
很多 C 扩展(如 NumPy、Cython)假设 GIL 存在,用 GIL 来保护共享状态。自由线程模式下,这些扩展需要用显式的锁来替代 GIL。
3. 一些并发假设需要改变
有些代码假设 GIL 存在(例如,认为"在两条字节码之间不可能有其他线程修改数据")。自由线程模式下,这个假设不再成立。

Python 3.14:自由线程正式落地

安装自由线程 Python

Python 3.14 的自由线程版本需要单独安装:
方法一:使用 pyenv(推荐)pyenv install 3.14.0t # t 代表 free-threadedpyenv local 3.14.0t# 方法二:使用官方 CPython 源码编译git clone https://github.com/python/cpython.gitcd cpythongit checkout v3.14.0t./configure --disable-gil --prefix=$HOME/python-ftmake -j$(nproc)make install# 验证python --version# Python 3.14.0 (tags/v3.14.0t:...) ← 注意末尾的 t

检测是否为自由线程 Python

import sysif sys.build_config.free_threaded: print("✅ 这是自由线程 Python") print(f" GIL 可用: {sys._is_gil_enabled()}"可以动态启用/禁用 GILelse: print("❌ 这是标准 Python,GIL 强制启用")

动态控制 GIL(Python 3.14 新 API)

import sysprint(f"GIL 当前状态: {'启用'if sys._is_gil_enabled() else'禁用'}")临时禁用 GIL(仅在自由线程 Python 中有效)if hasattr(sys, '_set_gil_enabled'): # 在某个代码段禁用 GIL with sys._disabled_gil(): # 这里没有 GIL,真正的多线程并行 result = sum(i * i for i in range(10_000_000)) print(f"禁用GIL计算结果: {result}") # 退出上下文后 GIL 自动恢复 print(f"GIL 恢复: {'启用'if sys._is_gil_enabled() else'禁用'}")

多线程性能实测

import threadingimport timeimport sysdef parallel_sum(n, name): start = time.perf_counter() total = sum(i * i for i in range(n)) elapsed = time.perf_counter() - start return name, elapsed, totalN = 20_000_000num_threads = 4单线程基准print(f"=== 单线程基准 ===")start = time.perf_counter()_, single_time, _ = parallel_sum(N, "基准")print(f"耗时: {single_time:.3f}s")# 多线程print(f"\n=== {num_threads} 线程 ===")threads = []results = []start = time.perf_counter()chunk = N // num_threadsfor i in range(num_threads): t = threading.Thread(target=lambda idx=i: results.append(parallel_sum(chunk, f"线程{idx}"))) threads.append(t) t.start()for t in threads: t.join()multi_time = time.perf_counter() - startprint(f"总耗时: {multi_time:.3f}s")print(f"加速比: {single_time/multi_time:.2f}x")if sys.build_config.free_threaded: if single_time/multi_time > 2.0: print("🎉 真正的多线程加速!自由线程生效!") else: print("⚠️ 加速比不高,可能受其他因素影响")else: if single_time/multi_time < 1.2: print("🔒 标准 Python,GIL 限制了多线程性能")
预期输出(自由线程 Python)
预期输出(标准 Python)

谁受益最大?

受益明显

1. CPU 密集型的多线程程序
图像处理:并行处理多张图片from PIL import Imageimport threadingimport osdef process_image(image_path, output_path): """CPU 密集型:图像滤镜处理""" img = Image.open(image_path) # 复杂的滤镜计算 filtered = img.filter(Image.Filter.SMOOTH) filtered.save(output_path)# 以前:GIL 导致多线程无效# 现在:4 线程可以真正并行处理 4 张图片threads = []for i, img_file in enumerate(image_files): t = threading.Thread(target=process_image, args=(img_file, f"out_{i}.jpg")) threads.append(t) t.start()
2. 科学计算 + 多数据集
同时对多个数据集做 NumPy 计算import numpy as npimport threadingdef compute_stats(dataset): """对数据集做统计分析""" data = np.load(dataset) return { 'mean': np.mean(data), 'std': np.std(data), 'max': np.max(data), }# 以前:4 个数据集串行处理# 现在:4 个线程真正并行results = []threads = [threading.Thread(target=lambda d=d: results.append(compute_stats(d))) for d in datasets]for t in threads: t.start()for t in threads: t.join()
3. 并行爬虫/并发 IO(间接受益)虽然 IO 操作本身不受 GIL 影响,但爬虫中通常夹杂着一些数据处理逻辑(JSON 解析、正则匹配等),自由线程可以让这些操作真正并行。

受益有限

1. IO 密集型程序:aiohttp、asyncio 已经可以很好地处理 IO 并发,GIL 本来就不是瓶颈。
2. NumPy 大矩阵运算:NumPy 的核心计算已经在 C 代码中释放了 GIL,不依赖 Python 多线程。
3. 单线程程序:没有多线程需求,GIL 存在与否没有区别。

与多解释器的关系:两条互补的路线

PEP 734(多解释器)vs PEP 703(自由线程)
这是两个互补的方案,解决不同的问题:
维度PEP 703 自由线程PEP 734 多解释器
隔离性共享内存,需自行加锁完全隔离(进程级)
效率线程级(轻量)解释器级(较轻量)
适用场景CPU 密集多线程任务隔离、插件沙箱
C 扩展兼容需要适配完全兼容
上线状态Python 3.14 官方支持Python 3.14 标准库
两条路可以结合使用吗?可以。在一个自由线程的 Python 进程中,运行多个解释器,每个解释器内部都是多线程的。这是 Python 并发的"双剑合璧"。

C 扩展生态:NumPy 们还好吗?

这是自由线程最大的担忧。Python 的科学计算生态(NumPy、Pandas、SciPy)大量依赖 C 扩展。这些扩展的作者假设 GIL 存在,用 GIL 来保护共享状态。

当前状态

NumPy:已经开始适配自由线程。主要数值运算函数(如 np.dot、np.add)已经可以在自由线程模式下安全使用。但某些操作仍需要显式加锁。
NumPy 在自由线程 Python 中的行为import numpy as npimport sysprint(f"NumPy 版本: {np.version}")print(f"自由线程 Python: {sys.build_config.free_threaded}")# 基础运算:安全a = np.random.rand(10001000)b = np.random.rand(10001000)import threadingresults = []def matmul_task(): results.append(np.dot(a, b))threads = [threading.Thread(target=matmul_task) for _ in range(4)]for t in threads: t.start()for t in threads: t.join()print(f"完成 {len(results)} 次矩阵乘法")# 在自由线程 NumPy 中,这 4 次运算是真正并行的!
Cython:Cython 3.1+ 支持自由线程。需要使用 --freethreaded 编译选项。
其他 C 扩展:逐步适配中。Python 3.14 的自由线程版本目前兼容性在70-80%左右,一些主流库(NumPy、SciPy、Pandas)已经基本适配。

如何检查 C 扩展的兼容性

import sysimport importlib.utildef check_extension_compatibility(package_name): """检查某个包的自由线程兼容性""" try: mod = importlib.import_module(package_name)检查是否有 _allow_free_threading 标记 if hasattr(mod, '_is_free_threaded_safe'): safe = mod._is_free_threaded_safe() status = "✅ 兼容" if safe else "⚠️ 部分兼容" print(f"{package_name}{status}") else: print(f"{package_name}: ❓ 未知(建议查阅官方文档)") except ImportError: print(f"{package_name}: 未安装")check_extension_compatibility('numpy')check_extension_compatibility('pandas')check_extension_compatibility('cython')

迁移决策框架:你要不要切换?

切换的好处

多线程 CPU 程序性能提升 2-4 倍
不需要学习 multiprocessing 的复杂 API
共享内存比进程间通信更简单

切换的风险

单线程程序轻微性能下降(2-5%)
C 扩展兼容性需要确认
已有代码的线程安全假设可能需要审查

决策树

渐进式迁移策略

如果你不确定,可以采用渐进式迁移import sys# 检测是否在自由线程模式下is_free_threaded = sys.build_config.free_threaded if hasattr(sys, 'build_config'else False# 动态选择策略if is_free_threaded: # 使用多线程 from concurrent.futures import ThreadPoolExecutorelse: # 回退到 multiprocessing from concurrent.futures import ProcessPoolExecutordef parallel_task(data): # 业务逻辑 ...with ThreadPoolExecutor(max_workers=4as executor: results = list(executor.map(parallel_task, datasets))

总结:Python 并发的"终极形态"

回顾 Python 并发的演进史:
Python 3.14 的自由线程支持,不是为了取代 multiprocessing,也不是为了取代 asyncio。它是为了填补"轻量多线程"这个空白
有些场景下,你需要真正的并行计算,但 multiprocessing 太重,asyncio 帮不上忙,threading 又受 GIL 限制。自由线程 Python 就是为这个场景而生的。
这是一次"底层革命"。它不会让每个人的 Python 程序都快 10 倍。但对于那些真正需要多线程 CPU 并行的人来说,这是一个等待了 20 多年的礼物。
欢迎评论区交流学习

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 11:06:39 HTTP/2.0 GET : https://f.mffb.com.cn/a/488507.html
  2. 运行时间 : 0.094602s [ 吞吐率:10.57req/s ] 内存消耗:4,958.95kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=4584a4ab11f7a42e2d912b28fcbb6cc2
  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.000528s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000756s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000319s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000281s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000528s ]
  6. SELECT * FROM `set` [ RunTime:0.000216s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000615s ]
  8. SELECT * FROM `article` WHERE `id` = 488507 LIMIT 1 [ RunTime:0.002531s ]
  9. UPDATE `article` SET `lasttime` = 1783134399 WHERE `id` = 488507 [ RunTime:0.007810s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000341s ]
  11. SELECT * FROM `article` WHERE `id` < 488507 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000527s ]
  12. SELECT * FROM `article` WHERE `id` > 488507 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000571s ]
  13. SELECT * FROM `article` WHERE `id` < 488507 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001966s ]
  14. SELECT * FROM `article` WHERE `id` < 488507 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001477s ]
  15. SELECT * FROM `article` WHERE `id` < 488507 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.003983s ]
0.096461s