当前位置:首页>python>Python 太慢?Numba JIT 编译,因子计算提速 100 倍

Python 太慢?Numba JIT 编译,因子计算提速 100 倍

  • 2026-06-29 08:52:17
Python 太慢?Numba JIT 编译,因子计算提速 100 倍

Python 写策略很爽,但有一个致命弱点:

前面聊了 Polars(6/3) 和 DuckDB(6/6) 解决数据处理的速度问题。但有些计算——比如逐 K 线遍历、路径依赖型策略、蒙特卡洛模拟——必须用 for 循环,Polars/DuckDB 帮不上忙。

今天聊 Numba——1.1 万 Star,LLVM JIT 编译器。加一行 @njit,你的 Python for 循环就能跑出 C 的速度。

项目地址: https://github.com/numba/numba

⭐ 11,000+ Stars | 1,200+ Forks | Python | BSD-2 License

官方文档: https://numba.readthedocs.io


它是什么?

Numba = Python 的 JIT(即时)编译器。

code

Python 慢的原因:
  Python 是解释型语言
  每一行代码都要经过 Python 解释器
  for 循环尤其慢——每次迭代都有解释开销

Numba 的原理:
  ┌──────────────────────────────────────────┐
  │  你的 Python 函数                        │
  │    ↓  @njit 装饰器                       │
  │  Numba 分析代码 + 推断类型               │
  │    ↓  LLVM 编译器                        │
  │  原生机器码(和 C 一样快)               │
  └──────────────────────────────────────────┘

  第一次调用:编译(稍慢)
  第二次调用:直接跑机器码(极快)

结果:
  for 循环提速 50-200 倍
  不用学 C / C++ / Rust
  不用改算法
  只加一行装饰器

快速上手

安装

bash

pip install numba

第一个 @njit

python

from numba import njit
import numpy as np
import time

# 纯 Python 版本
defslow_sum(arr):
    total = 0.0
for i inrange(len(arr)):
        total += arr[i]
return total

# Numba 版本——只加了一行 @njit
@njit
deffast_sum(arr):
    total = 0.0
for i inrange(len(arr)):
        total += arr[i]
return total

arr = np.random.rand(10_000_000)

# 纯 Python
t0 = time.time()
slow_sum(arr)
print(f"Python: {time.time() - t0:.3f}s")

# Numba(第一次调用包含编译时间)
fast_sum(arr)  # 预热编译

t0 = time.time()
fast_sum(arr)
print(f"Numba:  {time.time() - t0:.3f}s")

# 输出:
# Python: 2.340s
# Numba:  0.012s  ← 快了 195 倍!

量化实战场景

场景 1:自定义技术指标

python

from numba import njit
import numpy as np

@njit
defema(prices, period):
"""指数移动平均线——Numba 加速版"""
    result = np.empty_like(prices)
    alpha = 2.0 / (period + 1)

    result[0] = prices[0]
for i inrange(1len(prices)):
        result[i] = alpha * prices[i] + (1 - alpha) * result[i - 1]

return result

@njit
defrsi(prices, period=14):
"""RSI 指标——Numba 加速版"""
    result = np.full(len(prices), np.nan)
    gains = np.zeros(len(prices))
    losses = np.zeros(len(prices))

for i inrange(1len(prices)):
        change = prices[i] - prices[i - 1]
if change > 0:
            gains[i] = change
else:
            losses[i] = -change

# 初始平均
    avg_gain = np.mean(gains[1:period + 1])
    avg_loss = np.mean(losses[1:period + 1])

if avg_loss == 0:
        result[period] = 100.0
else:
        result[period] = 100.0 - 100.0 / (1 + avg_gain / avg_loss)

# 后续值
for i inrange(period + 1len(prices)):
        avg_gain = (avg_gain * (period - 1) + gains[i]) / period
        avg_loss = (avg_loss * (period - 1) + losses[i]) / period
if avg_loss == 0:
            result[i] = 100.0
else:
            result[i] = 100.0 - 100.0 / (1 + avg_gain / avg_loss)

return result

# 4000 只股票 × 250 天
prices = np.random.rand(4000250) * 100

# pandas 版要 5-10 秒,Numba 版 < 0.1 秒

场景 2:逐 K 线回测(路径依赖)

python

from numba import njit
import numpy as np

@njit
defbacktest_ma_cross(close, fast_period, slow_period, initial_cash):
"""均线交叉回测——逐 K 线遍历"""
    n = len(close)
    cash = initial_cash
    position = 0.0
    equity = np.empty(n)

for i inrange(slow_period, n):
# 计算均线
        fast_ma = np.mean(close[i - fast_period + 1:i + 1])
        slow_ma = np.mean(close[i - slow_period + 1:i + 1])

# 金叉买入
if fast_ma > slow_ma and position == 0:
            position = cash / close[i]
            cash = 0.0

# 死叉卖出
elif fast_ma < slow_ma and position > 0:
            cash = position * close[i]
            position = 0.0

# 记录净值
        equity[i] = cash + position * close[i]

return equity

# 单次回测
close = np.random.rand(5000) * 100 + 50
equity = backtest_ma_cross(close, 520100000.0)

场景 3:蒙特卡洛模拟

python

from numba import njit, prange
import numpy as np

@njit(parallel=True)
defmonte_carlo_portfolio(returns, n_simulations, n_days):
"""蒙特卡洛模拟——并行加速"""
    mean_ret = np.mean(returns)
    std_ret = np.std(returns)

    final_values = np.empty(n_simulations)

for sim in prange(n_simulations):  # prange = 并行循环
        portfolio = 1000000.0# 初始资金 100 万

for day inrange(n_days):
# 随机收益率
            daily_return = np.random.normal(mean_ret, std_ret)
            portfolio *= (1 + daily_return)

        final_values[sim] = portfolio

return final_values

# 10 万次模拟,250 天
returns = np.random.normal(0.00050.021000)
results = monte_carlo_portfolio(returns, 100_000250)

print(f"中位数终值: {np.median(results):,.0f}")
print(f"5% VaR:     {np.percentile(results, 5):,.0f}")
print(f"95%分位:    {np.percentile(results, 95):,.0f}")

场景 4:批量参数扫描

python

from numba import njit, prange
import numpy as np

@njit
defsingle_backtest(close, fast, slow):
"""单次回测,返回 Sharpe"""
    n = len(close)
    returns = np.empty(n)
    pos = 0.0
    prev_equity = 100000.0

for i inrange(slow, n):
        fast_ma = np.mean(close[i - fast + 1:i + 1])
        slow_ma = np.mean(close[i - slow + 1:i + 1])

if fast_ma > slow_ma and pos == 0:
            pos = prev_equity / close[i]
elif fast_ma < slow_ma and pos > 0:
            prev_equity = pos * close[i]
            pos = 0.0

        equity = prev_equity if pos == 0else pos * close[i]
        returns[i] = (equity - prev_equity) / prev_equity if prev_equity > 0else0
        prev_equity = equity

    valid = returns[slow:]
if np.std(valid) == 0:
return0.0
return np.mean(valid) / np.std(valid) * np.sqrt(252)

@njit(parallel=True)
defparameter_sweep(close, fast_range, slow_range):
"""批量参数扫描——并行"""
    n_fast = len(fast_range)
    n_slow = len(slow_range)
    results = np.empty((n_fast, n_slow))

for i in prange(n_fast):
for j inrange(n_slow):
if fast_range[i] >= slow_range[j]:
                results[i, j] = np.nan
else:
                results[i, j] = single_backtest(
                    close, fast_range[i], slow_range[j]
                )

return results

# 扫描 fast=[3..30], slow=[10..120]
close = np.random.rand(2000) * 100 + 50
fast_range = np.arange(331)
slow_range = np.arange(10121)

sharpe_matrix = parameter_sweep(close, fast_range, slow_range)
# 28 × 111 = 3108 次回测,并行执行

Numba 的三个关键装饰器

python

from numba import njit, jit, vectorize

# 1. @njit(推荐,nopython 模式)
#    完全编译为机器码,不调用 Python 解释器
#    最快,但有类型限制
@njit
deffast_func(x):
return x ** 2

# 2. @njit(parallel=True) + prange
#    自动并行化循环
@njit(parallel=True)
defparallel_func(arr):
    result = np.empty_like(arr)
for i in prange(len(arr)):
        result[i] = arr[i] ** 2
return result

# 3. @vectorize
#    自定义 ufunc(逐元素操作)
from numba import float64
@vectorize([float64(float64, float64)])
defclip_return(ret, threshold):
if ret > threshold:
return threshold
elif ret < -threshold:
return -threshold
return ret

Numba 能加速什么 / 不能加速什么

场景
Numba 效果
说明
for 循环
50-200x
Numba 最擅长的
NumPy 数组运算
1-5x
NumPy 本身已经优化过
蒙特卡洛
50-100x
大量循环 + 随机数
逐 K 线回测
50-200x
路径依赖,必须循环
自定义指标
20-100x
EMA/RSI 等迭代计算
参数扫描
50-200x
+ prange 并行更快
pandas 操作
不支持
Numba 不认识 pandas
字符串处理
不支持
Numba 不擅长字符串
网络请求
不支持
I/O 不是计算瓶颈
复杂 class
有限支持
简单 class 可以

code

Numba 的黄金法则:
  "如果你的瓶颈是 for 循环 + 数值计算,
   Numba 就是你的答案。"

  "如果你的瓶颈是 I/O / 网络 / 数据库,
   Numba 帮不了你——用 DuckDB / Polars。"

Numba + 本系列工具

组合
用法
Numba + XGBoost(6/7)
加速因子计算,喂给 XGBoost
Numba + Optuna(6/5)
加速目标函数中的回测循环
Numba + pandas-ta(5/21)
自定义指标替代 pandas-ta 的慢函数
Numba + vectorbt(5/1)
vectorbt 底层就是用 Numba 加速的
Numba + Backtesting.py(5/17)
自定义指标函数用 Numba 加速

典型工作流

code

完整加速方案:
  ┌────────────────────────────────────┐
  │  数据层:DuckDB(SQL 查大文件)    │
  │    ↓                               │
  │  清洗层:Polars(DataFrame 加工)  │
  │    ↓                               │
  │  计算层:Numba(因子循环加速)     │
  │    ↓                               │
  │  模型层:XGBoost(因子建模)       │
  │    ↓                               │
  │  调参层:Optuna(超参数优化)      │
  │    ↓                               │
  │  分析层:QuantStats(绩效报告)    │
  └────────────────────────────────────┘

  每一层用最合适的工具,
  每一层都跑在最优性能。

常见陷阱

陷阱
解法
首次调用慢
第一次调用包含编译时间,第二次才是真实速度
类型不匹配
Numba 需要确定类型,传入 NumPy 数组而非 list
pandas 不支持
先用 .values 转成 NumPy 数组
全局变量
@njit 函数内不要用全局变量,通过参数传入
debug 困难
先不加 @njit 调通逻辑,再加装饰器

python

# 常见错误:传入 pandas Series
@njit
defbad_func(series):  # ← 会报错
    ...

# 正确做法:传入 numpy array
@njit
defgood_func(arr):
    ...

# 调用时转换
result = good_func(df['close'].values)  # ← .values 转 numpy

Numba vs 其他加速方案

方案
速度提升
难度
适用
Numba @njit
50-200x
低(加一行)
循环密集型
Polars
(6/3)
10-100x
DataFrame 操作
Cython
50-200x
中(要写类型)
通用
C 扩展
100-500x
高(要会 C)
极致性能
Rust (PyO3)
100-500x
高(要会 Rust)
NautilusTrader 的路

code

选择建议:
  DataFrame 操作慢 → Polars
  SQL 查询慢 → DuckDB
  for 循环慢 → Numba(推荐)
  极致性能 → Cython / Rust
  不想改代码 → 升级硬件

局限性

局限
说明
不支持 pandas
只支持 NumPy 数组和基本 Python 类型
不支持所有 Python
字典 / 复杂 class / 动态类型受限
首次编译开销
第一次调用需要编译,有延迟
调试困难
编译后的代码难以 debug
GPU 支持有限
CUDA 支持需要额外配置

code

关键认知:
  Numba 不是"让所有 Python 代码变快"——
  它是"让数值循环代码变快"的专用工具。

  最佳实践:
    1. 先写纯 Python,调通逻辑
    2. 用 profiler 找到瓶颈函数
    3. 只给瓶颈函数加 @njit
    4. 传入 NumPy 数组
    5. 享受 100 倍加速

小结

code

Numba:
- 11,000+ Star,Python JIT 编译器
- 加一行 @njit → for 循环快 50-200 倍
- 基于 LLVM,编译为原生机器码
- prange 并行循环,利用多核 CPU
- 完美支持 NumPy 数组
- 量化场景:因子计算 / 逐 K 线回测 / 蒙特卡洛
- BSD-2 开源协议

量化性能加速全景:
  数据查询 → DuckDB(SQL)
  数据加工 → Polars(DataFrame)
  数值循环 → Numba(JIT 编译)
  引擎底层 → Rust / C++(NautilusTrader)

一句话:
  "不用学 C++,不用换语言——
   @njit 一行,Python 起飞。"

⚠️ 免责声明:Numba 是性能优化工具,不构成投资建议。本文仅介绍技术工具,投资决策请综合多方信息。


#Numba #JIT #性能优化 #Python加速 #蒙特卡洛 #量化投资 #投资

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 09:32:17 HTTP/2.0 GET : https://f.mffb.com.cn/a/498296.html
  2. 运行时间 : 0.110373s [ 吞吐率:9.06req/s ] 内存消耗:4,533.92kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=8a650608a40e9e3afd0264b456812f62
  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.000656s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000923s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000345s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000306s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000481s ]
  6. SELECT * FROM `set` [ RunTime:0.000200s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000624s ]
  8. SELECT * FROM `article` WHERE `id` = 498296 LIMIT 1 [ RunTime:0.000521s ]
  9. UPDATE `article` SET `lasttime` = 1783042337 WHERE `id` = 498296 [ RunTime:0.026266s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000415s ]
  11. SELECT * FROM `article` WHERE `id` < 498296 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000560s ]
  12. SELECT * FROM `article` WHERE `id` > 498296 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.007465s ]
  13. SELECT * FROM `article` WHERE `id` < 498296 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001610s ]
  14. SELECT * FROM `article` WHERE `id` < 498296 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000874s ]
  15. SELECT * FROM `article` WHERE `id` < 498296 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000903s ]
0.112019s