当前位置:首页>python>Nsight Python 简介

Nsight Python 简介

  • 2026-02-18 19:56:35
Nsight Python 简介

0x0. 前言

代码仓:https://github.com/NVIDIA/nsight-python

Nsight Python(nsight-python)是基于 NVIDIA Nsight Tools 的 Python profiling 接口,当前主要通过 Nsight Compute CLI(ncu 采集 CUDA kernel 的性能指标,并提供:

  • 基于 configs 的参数扫描(sweep)与多次重复运行(runs
  • 指标提取为 pandas DataFrame(ProfileResults.to_dataframe()
  • 可选的图表输出(@nsight.analyze.plot)与 CSV (output_csv

工作方式为“两段执行”模型:第一次运行作为 launcher,内部调用 ncu 再次执行脚本完成 profiling,然后解析 .ncu-rep 输出结果。

个人感觉这个工具现在可以更容易和Agent配合,例如可以把采集一些重要Metrics的example脚本整理成SKILLS作为Agent的辅助工具,帮助Agent写出更快的kernel代码,毕竟原始的NCU文件Agent是无法识别的。

0x1. 环境与依赖

  • Python 3.10+
  • CUDA-capable GPU
  • NVIDIA Nsight Compute CLI(ncu,需在 PATH
  • PyTorch
  • Triton(可选,仅 07_triton_minimal.py 需要)

Quick Start(以官方 examples 为例):

cd examplespython 00_minimal.py

0x2. 常用 API

2.1 nsight.annotate(name, ignore_failures=False)

用途:标记 NVTX range,用于在 ncu 报告中定位需要 profile 的区域。支持 context manager 与 decorator 两种形式。

限制:

  • 同一 profiling run 内 annotation 名称需要唯一
  • 不支持嵌套 annotation

2.2 @nsight.analyze.kernel(...)

用途:对被装饰函数执行 profiling,返回 ProfileResults

常用参数:

  • configs:配置列表(用于 sweep)
  • runs:每个配置重复次数
  • metricsncu 指标名列表,默认 gpu__time_duration.sum
  • derive_metric:将采集的指标转换为自定义指标(标量或 dict
  • normalize_against:按指定 annotation 做归一化(当前 / baseline)
  • ignore_kernel_list:忽略某些 kernel
  • combine_kernel_metrics:一个 annotation 内启动多个 kernel 时的合并策略(二元函数)
  • replay_mode"kernel" | "range"
  • cache_control"all" | "none"
  • clock_control"base" | "none"
  • thermal_mode"auto" | "manual" | "off"(可配 thermal_wait/thermal_cont/thermal_timeout
  • output_csv / output_prefix:CSV 输出与路径前缀

2.3 @nsight.analyze.plot(...)

用途:对 @nsight.analyze.kernel 的输出进行可视化。

常用参数:

  • filename
  • metric:当存在多个 metric(多 metrics 或使用 derive_metric)时需要显式指定
  • plot_type"line" | "bar"
  • row_panels / col_panels:子图布局
  • variant_fields / variant_annotations:将同一 annotation 在不同参数取值下拆成多条线
  • plot_callback:自定义 matplotlib 样式

限制:@nsight.analyze.plot 一次仅支持可视化单个 metric。

0x3. Examples

examples 从 00_minimal.py 开始按复杂度递增,建议顺序阅读与执行。我在H100简单跑了一下这些例子,有选择的粘贴了一些结果。

00_minimal.py:最小示例

  • 基础 @nsight.analyze.kernel 用法
  • 单个 with nsight.annotate(...) 标记范围
  • 通过 ProfileResults.to_dataframe() 查看聚合结果
 examples python3 00_minimal.py ╔══════════════════════════════════════════════════════════════════════════════╗║                          Profiling benchmark_matmul                          ║║                        1 configurations, 1 runs each                         ║╚══════════════════════════════════════════════════════════════════════════════╝Config 1/1: ['1024']Progress: [████████████████████████████████████████████████████████████████████████████████████████████████████] 100.00% | Estimated time remaiProgress: [████████████████████████████████████████████████████████████████████████████████████████████████████] 100.00% | Estimated time remaining: 00:00:00[NSIGHT-PYTHON] Profiling completed successfully ![NSIGHT-PYTHON] Refer to /tmp/nspy_wtlxvsfq/ncu-output-benchmark_matmul-0.ncu-rep for the NVIDIA Nsight Compute CLI report[NSIGHT-PYTHON] Refer to /tmp/nspy_wtlxvsfq/ncu-output-benchmark_matmul-0.log for the NVIDIA Nsight Compute CLI logs[NSIGHT-PYTHON] Loading profiled dataExtracting profiling dataExtracting matmul profiling data[NSIGHT-PYTHON] Processing profiled data  Annotation     n                  Metric AvgValue  NumRuns                    GPU0     matmul  1024  gpu__time_duration.sum  61088.0        1  NVIDIA H100 80GB HBM3Benchmark complete!

01_compare_throughput.py:对比不同实现(采集吞吐指标)

  • 同一函数内多个 annotate 区间用于对比
  • 使用 metrics=["dram__throughput.avg.pct_of_peak_sustained_elapsed"] 采集 DRAM 吞吐指标
  • @nsight.annotate 作为函数 decorator 的用法
  • print_data=True 打印绘图数据
examples python3 01_compare_throughput.py ╔══════════════════════════════════════════════════════════════════════════════╗║                    Profiling benchmark_matmul_throughput                     ║║                        1 configurations, 10 runs each                        ║╚══════════════════════════════════════════════════════════════════════════════╝Config 1/1: ['2048']Progress: [██████████------------------------------------------------------------------------------------------] 10.00% | Estimated time remainProgress: [████████████████████████████████████████████████████████████████████████████████--------------------] 80.00% | Estimated time remainProgress: [████████████████████████████████████████████████████████████████████████████████████████████████████] 100.00% | Estimated time remaining: 00:00:00[NSIGHT-PYTHON] Profiling completed successfully ![NSIGHT-PYTHON] Refer to /tmp/nspy_sj37qt83/ncu-output-benchmark_matmul_throughput-0.ncu-rep for the NVIDIA Nsight Compute CLI report[NSIGHT-PYTHON] Refer to /tmp/nspy_sj37qt83/ncu-output-benchmark_matmul_throughput-0.log for the NVIDIA Nsight Compute CLI logs[NSIGHT-PYTHON] Loading profiled dataExtracting profiling dataExtracting @-operator profiling dataExtracting torch.matmul profiling dataExtracting torch.einsum profiling data[NSIGHT-PYTHON] Processing profiled data     Annotation                                             Metric     n  AvgValue  ...  RelativeStdDevPct StableMeasurement Normalized   Geomean0    @-operator  dram__throughput.avg.pct_of_peak_sustained_ela...  2048  2.960419  ...           2.300243             False      False  2.9604191  torch.matmul  dram__throughput.avg.pct_of_peak_sustained_ela...  2048   2.93248  ...           0.394342              True      False  2.9324802  torch.einsum  dram__throughput.avg.pct_of_peak_sustained_ela...  2048  2.937353  ...           0.665138              True      False  2.937353[3 rows x 19 columns]✓ Benchmark complete! Check '01_compare_throughput.png'Tip: Run 'ncu --query-metrics' to see all available metrics!

02_parameter_sweep.py:参数扫描(configs sweep)

  • configs=[(n1,), (n2,), ...] 扫描不同输入规模
  • 被装饰函数可不显式传参,参数来自 configs
python3 02_parameter_sweep.py   ╔══════════════════════════════════════════════════════════════════════════════╗║                       Profiling benchmark_matmul_sizes                       ║║                        3 configurations, 10 runs each                        ║╚══════════════════════════════════════════════════════════════════════════════╝Config 1/3: ['2048']Config 3/3: ['8192']Progress: [████████████████████████████████████████████████████████████████████████████████--------------------] 80.00% | Estimated time remainProgress: [████████████████████████████████████████████████████████████████████████████████████████████████████] 100.00% | Estimated time remaining: 00:00:00[NSIGHT-PYTHON] Profiling completed successfully ![NSIGHT-PYTHON] Refer to /tmp/nspy_9mf071wx/ncu-output-benchmark_matmul_sizes-0.ncu-rep for the NVIDIA Nsight Compute CLI report[NSIGHT-PYTHON] Refer to /tmp/nspy_9mf071wx/ncu-output-benchmark_matmul_sizes-0.log for the NVIDIA Nsight Compute CLI logs[NSIGHT-PYTHON] Loading profiled dataExtracting profiling dataExtracting matmul profiling data[NSIGHT-PYTHON] Processing profiled data  Annotation                  Metric     n    AvgValue  ...  RelativeStdDevPct StableMeasurement Normalized       Geomean0     matmul  gpu__time_duration.sum  2048    341628.8  ...            0.12064              True      False  2.676955e+061     matmul  gpu__time_duration.sum  4096   2653696.0  ...           0.146789              True      False  2.676955e+062     matmul  gpu__time_duration.sum  8192  21160092.8  ...           0.038769              True      False  2.676955e+06[3 rows x 19 columns]✓ Benchmark complete! Check '02_parameter_sweep.png'

03_custom_metrics.pyderive_metric 自定义指标(TFLOPS/算术强度)

  • derive_metric 返回标量与返回 dict 两种模式
  • 当存在多个 metric 时,@nsight.analyze.plot(metric=...) 需要显式指定
    • 标量返回:metric 为 derive_metric 函数名
    • dict 返回:metric 为字典 key
 python3 03_custom_metrics.py Running TFLOPs benchmark (scalar return pattern)...Running TFLOPs benchmark (scalar return pattern)...╔══════════════════════════════════════════════════════════════════════════════╗║                          Profiling benchmark_tflops                          ║║                        3 configurations, 10 runs each                        ║╚══════════════════════════════════════════════════════════════════════════════╝Config 1/3: ['2048']Config 3/3: ['8192']Progress: [███████████████████████████████████████████████████████████████████████████████████-----------------] 83.33% | Estimated time remainProgress: [████████████████████████████████████████████████████████████████████████████████████████████████████] 100.00% | Estimated time remaining: 00:00:00[NSIGHT-PYTHON] Profiling completed successfully ![NSIGHT-PYTHON] Refer to /tmp/nspy_3dclsban/ncu-output-benchmark_tflops-0.ncu-rep for the NVIDIA Nsight Compute CLI report[NSIGHT-PYTHON] Refer to /tmp/nspy_3dclsban/ncu-output-benchmark_tflops-0.log for the NVIDIA Nsight Compute CLI logs[NSIGHT-PYTHON] Loading profiled dataExtracting profiling dataExtracting matmul profiling data[NSIGHT-PYTHON] Processing profiled data✓ TFLOPs benchmark complete! Check '03_custom_metrics_tflops.png'Running combined benchmark (dictionary return pattern)...Running TFLOPs benchmark (scalar return pattern)...✓ TFLOPs benchmark complete! Check '03_custom_metrics_tflops.png'Running combined benchmark (dictionary return pattern)...╔══════════════════════════════════════════════════════════════════════════════╗║             Profiling benchmark_tflops_and_arithmetic_intensity              ║║                        3 configurations, 10 runs each                        ║╚══════════════════════════════════════════════════════════════════════════════╝Config 1/3: ['2048']Config 3/3: ['8192']Progress: [██████████████████████████████████████████████████████████████████████████████████████--------------] 86.67% | Estimated time remainProgress: [████████████████████████████████████████████████████████████████████████████████████████████████████] 100.00% | Estimated time remaining: 00:00:00[NSIGHT-PYTHON] Profiling completed successfully ![NSIGHT-PYTHON] Refer to /tmp/nspy_2b0qn_d1/ncu-output-benchmark_tflops_and_arithmetic_intensity-0.ncu-rep for the NVIDIA Nsight Compute CLI report[NSIGHT-PYTHON] Refer to /tmp/nspy_2b0qn_d1/ncu-output-benchmark_tflops_and_arithmetic_intensity-0.log for the NVIDIA Nsight Compute CLI logs[NSIGHT-PYTHON] Loading profiled dataExtracting profiling dataExtracting matmul profiling data[NSIGHT-PYTHON] Processing profiled data  Annotation                  Metric     n     AvgValue  ...  RelativeStdDevPct StableMeasurement Normalized       Geomean0     matmul  gpu__time_duration.sum  2048     341728.0  ...             0.1115              True      False  2.680363e+061     matmul  gpu__time_duration.sum  4096    2653417.6  ...           0.177246              True      False  2.680363e+062     matmul  gpu__time_duration.sum  8192   21237062.4  ...           0.287651              True      False  2.680363e+063     matmul                  TFLOPS  2048    50.273575  ...           0.111437              True      False  5.127645e+014     matmul          ArithIntensity  2048   341.333333  ...                0.0              True      False  6.826667e+025     matmul                  TFLOPS  4096    51.797101  ...           0.176597              True      False  5.127645e+016     matmul          ArithIntensity  4096   682.666667  ...                0.0              True      False  6.826667e+027     matmul                  TFLOPS  8192    51.773631  ...           0.287988              True      False  5.127645e+018     matmul          ArithIntensity  8192  1365.333333  ...                0.0              True      False  6.826667e+02[9 rows x 19 columns]✓ TFLOPs and Arithmetic Intensity benchmark complete! Check '03_custom_metrics_arith_intensity.png'

04_multi_parameter.py:多参数扫描(itertools.product

  • 同时扫描多个参数(如 size、dtype)
  • derive_metric(time_ns, *conf) 使用 *conf 处理多参数输入

05_subplots.py:子图网格(faceting)

  • row_panels / col_panels 将不同参数映射到子图维度
  • 适用于多变量对比的可视化组织

06_plot_customization.py:绘图定制

  • plot_type="bar" 与默认 line plot 的切换
  • plot_callback(fig) 进行更细粒度的 matplotlib 样式控制

07_triton_minimal.py:Triton 集成与 variants

  • profiling Triton kernel
  • normalize_against="torch":按 baseline 做归一化
  • derive_metric 计算 speedup(示例中对归一化结果取倒数)
  • variant_fields / variant_annotations:按参数(如 block_size)拆分曲线

08_multiple_metrics.py:一次采集多个 metrics

  • metrics=[m1, m2, ...] 同时采集多个指标
  • 结果在 DataFrame 的 Metric 列中区分
  • 限制:@nsight.analyze.plot 不支持多 metric 一次绘图
import torchimport nsightsizes = [(2**i,) for i in range(11, 13)]@nsight.analyze.kernel(    configs=sizes,    runs=5,    # Collect both shared memory load and store SASS instructions    metrics=[        "smsp__sass_inst_executed_op_shared_ld.sum",        "smsp__sass_inst_executed_op_shared_st.sum",    ],)def analyze_shared_memory_ops(n: int) -> None:    """Analyze both shared memory load and store SASS instructions    for different kernels.    Note: To evaluate multiple metrics, pass them as a sequence    (list/tuple). All results are merged into one ProfileResults    object, with the 'Metric' column indicating each specific metric.    """    a = torch.randn(n, n, device="cuda")    b = torch.randn(n, n, device="cuda")    c = torch.randn(2 * n, 2 * n, device="cuda")    d = torch.randn(2 * n, 2 * n, device="cuda")    with nsight.annotate("@-operator"):        _ = a @ b    with nsight.annotate("torch.matmul"):        _ = torch.matmul(c, d)def main() -> None:    # Run analysis with multiple metrics    results = analyze_shared_memory_ops()    df = results.to_dataframe()    print(df)    unique_metrics = df["Metric"].unique()    print(f"\n✓ Collected {len(unique_metrics)} metrics:")    for metric in unique_metrics:        print(f"  - {metric}")    print("\n✓ Sample data:")    print(df[["Annotation", "n", "Metric", "AvgValue"]].to_string(index=False))    print("\n" + "=" * 60)    print("IMPORTANT: @plot decorator limitation")    print("=" * 60)    print("When multiple metrics are collected:")    print("  ✓ All metrics are collected in a single ProfileResults object")    print("  ✓ DataFrame has 'Metric' column to distinguish them")    print("  ✗ @nsight.analyze.plot decorator will RAISE AN ERROR")    print("    Why? @plot can only visualize one metric at a time.")    print("    Tip: Use separate @kernel functions for each metric or use")    print("         'derive_metric' to compute custom values.")if __name__ == "__main__":    main()
[NSIGHT-PYTHON] Processing profiled data     Annotation                                     Metric     n     AvgValue  ...  RelativeStdDevPct StableMeasurement Normalized       Geomean0    @-operator  smsp__sass_inst_executed_op_shared_ld.sum  2048   12720128.0  ...                0.0              True      False  3.588080e+071    @-operator  smsp__sass_inst_executed_op_shared_st.sum  2048     131072.0  ...                0.0              True      False  1.310720e+052    @-operator  smsp__sass_inst_executed_op_shared_ld.sum  4096  101212160.0  ...                0.0              True      False  3.588080e+073    @-operator  smsp__sass_inst_executed_op_shared_st.sum  4096     131072.0  ...                0.0              True      False  1.310720e+054  torch.matmul  smsp__sass_inst_executed_op_shared_ld.sum  2048  101212160.0  ...                0.0              True      False  2.858828e+085  torch.matmul  smsp__sass_inst_executed_op_shared_st.sum  2048     131072.0  ...                0.0              True      False  2.621440e+056  torch.matmul  smsp__sass_inst_executed_op_shared_ld.sum  4096  807501824.0  ...                0.0              True      False  2.858828e+087  torch.matmul  smsp__sass_inst_executed_op_shared_st.sum  4096     524288.0  ...                0.0              True      False  2.621440e+05[8 rows x 19 columns]✓ Collected 2 metrics:  - smsp__sass_inst_executed_op_shared_ld.sum  - smsp__sass_inst_executed_op_shared_st.sum✓ Sample data:  Annotation    n                                    Metric     AvgValue  @-operator 2048 smsp__sass_inst_executed_op_shared_ld.sum   12720128.0  @-operator 2048 smsp__sass_inst_executed_op_shared_st.sum     131072.0  @-operator 4096 smsp__sass_inst_executed_op_shared_ld.sum  101212160.0  @-operator 4096 smsp__sass_inst_executed_op_shared_st.sum     131072.0torch.matmul 2048 smsp__sass_inst_executed_op_shared_ld.sum  101212160.0torch.matmul 2048 smsp__sass_inst_executed_op_shared_st.sum     131072.0torch.matmul 4096 smsp__sass_inst_executed_op_shared_ld.sum  807501824.0torch.matmul 4096 smsp__sass_inst_executed_op_shared_st.sum     524288.0

09_advanced_metric_custom.py:基于多 metrics 计算派生指标

  • derive_metric 的参数顺序:先是 metrics 对应的值,后是被装饰函数的参数
  • 返回 dict 输出多个派生指标(示例选择其中一个绘图)

10_combine_kernel_metrics.py:单个 annotation 内多个 kernel 的合并

  • 典型场景:同一个 annotation 区间内执行多次 kernel
  • 使用 combine_kernel_metrics=lambda x, y: x + y 将多个 kernel 的指标合并为单值

11_output_csv.py:CSV 输出

  • output_csv=True 生成 raw 与 processed 两份 CSV
  • output_prefix 控制输出路径与命名前缀
# 本例目标:# - 用 @nsight.analyze.kernel(...) 做参数 sweep + 指标采集# - 打开 output_csv=True,把采集结果(原始/聚合后)写到 CSV,方便离线分析import osimport pandas as pdimport torchimport nsight# Get current directory for output# 用脚本所在目录作为输出目录,避免受当前工作目录(cwd)影响。current_dir = os.path.dirname(os.path.abspath(__file__))# output_prefix 会作为输出文件的“路径 + 文件名前缀”。# 例如这里生成的文件名通常会以 example11_ 开头,并落在 current_dir 下。output_prefix = f"{current_dir}/example11_"# Matrix sizes to benchmark# configs 需要是一个序列;每个元素会作为一次配置传入被装饰函数。# 这里每个 config 是 (n,) 的 1 元组,对应 analyze_memory_ops_with_csv(n)。sizes = [(2**i,) for i in range(1013)]@nsight.analyze.kernel(    configs=sizes,# 每个 config 重复 profile 的次数;nsight-python 会对 runs 次结果做统计聚合(Avg/Std 等)。    runs=3,    output_prefix=output_prefix,# output_csv=True:除返回 ProfileResults 外,还会把数据落盘为 CSV(便于归档/复现/画图)。    output_csv=True,  # Enable CSV file generation    metrics=[# metrics:Nsight Compute 采集的指标列表。# 列表顺序很重要:# - 结果 DataFrame 里用 'Metric' 列区分不同指标# - 若同时使用 derive_metric,其位置参数会按 metrics 的顺序对齐"smsp__sass_inst_executed_op_shared_ld.sum","smsp__sass_inst_executed_op_shared_st.sum",    ],)defanalyze_memory_ops_with_csv(n: int) -> None:"""    Analyze memory operations with CSV output enabled.    When output_csv=True, two CSV files are generated:    1. {prefix}processed_data-<name_of_decorated_function>-<run_id>.csv - Raw profiled data    2. {prefix}profiled_data-<name_of_decorated_function>-<run_id>.csv - Processed/aggregated data    Args:        n: Matrix size (n x n)    """# 在 GPU 上生成随机矩阵,触发 matmul 相关 kernel(通常来自 cuBLAS/GEMM 路径)。    a = torch.randn(n, n, device="cuda")    b = torch.randn(n, n, device="cuda")# nsight.annotate 会插入 NVTX range;最终会出现在结果的 'Annotation' 列。with nsight.annotate("matmul-operator"):        _ = a @ bwith nsight.annotate("torch-matmul"):        _ = torch.matmul(a, b)defprint_full_dataframe(    df: pd.DataFrame, max_rows: int = 20, max_col_width: int = 100) -> None:"""    Print DataFrame without truncation.    Args:        df: DataFrame to print        max_rows: Maximum number of rows to display (None for all rows)        max_col_width: Maximum column width (None for no limit)    """# Save current display options# pandas 默认会截断行/列/列宽;这里临时改 display 选项,打印更完整。    original_options = {"display.max_rows": pd.get_option("display.max_rows"),"display.max_columns": pd.get_option("display.max_columns"),"display.max_colwidth": pd.get_option("display.max_colwidth"),"display.width": pd.get_option("display.width"),"display.expand_frame_repr": pd.get_option("display.expand_frame_repr"),    }try:# Set display options for full output        pd.set_option("display.max_rows", max_rows if max_rows elseNone)        pd.set_option("display.max_columns"None)        pd.set_option("display.max_colwidth", max_col_width if max_col_width elseNone)        pd.set_option("display.width"None)        pd.set_option("display.expand_frame_repr"False)        print(df.to_string())finally:# Restore original options# 打印结束后恢复全局设置,避免影响其它地方的 DataFrame 显示。for option, value in original_options.items():            pd.set_option(option, value)defread_and_display_csv_files() -> None:"""Read and display the generated CSV files."""# Find CSV files# 扫描输出目录下 example11_*.csv(这些文件由 output_csv=True 自动生成)。    csv_files = []for file in os.listdir(current_dir):if file.startswith("example11_"and file.endswith(".csv"):            csv_files.append(os.path.join(current_dir, file))for file_path in sorted(csv_files):        file_name = os.path.basename(file_path)        print(f"\nFile: {file_name}")        print("-" * (len(file_name) + 6))# Read CSV filetry:            df = pd.read_csv(file_path)# Display only columns related to metrics/values# CSV 字段通常较多,这里只筛选包含 Annotation / Metric / Value 的列,便于快速浏览。            value_cols = [                colfor col in df.columnsif"Value"in col or"Metric"in col or"Annotation"in col            ]# print(df[value_cols].head())# Show full DataFrame without truncation            print_full_dataframe(df[value_cols])except Exception as e:            print(f"Error reading {file_name}{e}")defmain() -> None:# Clean up any previous output files# 为避免旧文件混淆,这里先删除之前生成的 example11_ 输出文件(有副作用操作)。for old_file in os.listdir(current_dir):if old_file.startswith("example11_"and old_file.endswith(            (".csv"".ncu-rep"".log")        ):            os.remove(os.path.join(current_dir, old_file))# Run the analysis with CSV output# 调用被 @kernel 装饰的函数会触发:configs * runs 次 profiling,并返回 ProfileResults。    result = analyze_memory_ops_with_csv()    print(result.to_dataframe())# Read and display generated CSV files    read_and_display_csv_files()if __name__ == "__main__":    main()

0x4. Examples中的限制

  • 单个 annotation 默认期望 1 个 kernel;多个 kernel 时可使用:
    • replay_mode="range"
    • combine_kernel_metrics
    • ignore_kernel_list
  • 多 metrics 场景下:DataFrame 可同时包含多个指标,但 @nsight.analyze.plot 仅支持一次绘制一个 metric

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-21 22:12:23 HTTP/2.0 GET : https://f.mffb.com.cn/a/475214.html
  2. 运行时间 : 0.211551s [ 吞吐率:4.73req/s ] 内存消耗:4,766.91kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=8c1d8448674ac26ece4faa0908a8b8fc
  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.000967s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001764s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000722s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000663s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001414s ]
  6. SELECT * FROM `set` [ RunTime:0.000523s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001097s ]
  8. SELECT * FROM `article` WHERE `id` = 475214 LIMIT 1 [ RunTime:0.000648s ]
  9. UPDATE `article` SET `lasttime` = 1771683143 WHERE `id` = 475214 [ RunTime:0.006342s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000288s ]
  11. SELECT * FROM `article` WHERE `id` < 475214 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000439s ]
  12. SELECT * FROM `article` WHERE `id` > 475214 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000361s ]
  13. SELECT * FROM `article` WHERE `id` < 475214 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001381s ]
  14. SELECT * FROM `article` WHERE `id` < 475214 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.014015s ]
  15. SELECT * FROM `article` WHERE `id` < 475214 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.011751s ]
0.213204s