已生成 200 个测试文件到 C:\Users\zhou\AppData\Local\Temp\fuscan_multi_rule\files
总字节数: 3866737 (3.69 MB)

================================================================================
=== 场景: S1 内置规则（14 条） ===
================================================================================

=== S1 内置规则（14 条） - perf_summary ===
总耗时: 1244.22ms (1.2442s)
各阶段累计耗时: 104.89ms

阶段                                 总计       占比       调用次数           平均           最大
-----------------------------------------------------------------------------------
match                         98.68ms     7.9%        600       0.16ms       3.12ms
walk                           6.21ms     0.5%          1       6.21ms       6.21ms

扫描文件数: 200
命中规则数: 230
吞吐量: 160.7 files/s

=== cProfile 热点（cumulative time 前 25）===
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    1.244    1.244 scanner.py:502(scan)
        1    0.000    0.000    1.233    1.233 scanner.py:720(scan_entries)
        1    0.000    0.000    1.233    1.233 _pipeline_phase.py:48(run_pipeline_phase)
        1    0.001    0.001    1.233    1.233 _pipeline_phase.py:71(_scan_sequential)
      200    0.000    0.000    1.230    0.006 scanner.py:1207(_scan_entry)
      200    0.002    0.000    1.228    0.006 scanner.py:1240(_scan_entry_uncached)
      200    0.000    0.000    1.113    0.006 _helpers.py:271(default_extract_content)
      200    0.000    0.000    1.112    0.006 base.py:483(extract_content_with_fallback)
      200    0.000    0.000    1.112    0.006 base.py:465(extract_content)
      200    0.000    0.000    1.112    0.006 base.py:275(extract)
      200    0.001    0.000    1.111    0.006 text.py:153(extract)
      200    0.001    0.000    1.100    0.006 pathlib.py:1122(read_bytes)
      200    0.000    0.000    1.091    0.005 pathlib.py:1111(open)
      200    1.091    0.005    1.091    0.005 {built-in method io.open}
      200    0.000    0.000    0.095    0.000 scanner.py:1112(_match_content_via_buckets_impl)
      200    0.050    0.000    0.095    0.000 _content_buckets.py:495(match_content_via_buckets)
      174    0.000    0.000    0.021    0.000 _content_buckets.py:465(_get_active_compiled)
       22    0.000    0.000    0.021    0.001 re.py:249(compile)
       22    0.000    0.000    0.021    0.001 re.py:288(_compile)
       22    0.000    0.000    0.020    0.001 sre_compile.py:783(compile)
     2362    0.001    0.000    0.020    0.000 {built-in method builtins.any}
      174    0.001    0.000    0.019    0.000 _content_buckets.py:442(_compute_active_indices)
     9575    0.017    0.000    0.017    0.000 _content_buckets.py:460(<genexpr>)
      200    0.007    0.000    0.012    0.000 _helpers.py:240(is_minified_content)
       22    0.000    0.000    0.011    0.000 sre_compile.py:622(_code)



=== 重点函数明细（按 fullname 部分匹配）===
函数                                                       ncalls      tottime      cumtime
-----------------------------------------------------------------------------------------
scanner.py:_match_content_via_buckets_impl                  200       0.21ms      95.23ms
_content_buckets.py:match_content_via_buckets               200      49.82ms      95.01ms
_content_buckets.py:_get_active_compiled                    174       0.24ms      21.10ms
_content_buckets.py:_compute_active_indices                 174       1.10ms      19.36ms
_content_buckets.py:<genexpr>                              9575      17.44ms      17.44ms
matchers.py:matches                                         400       0.42ms       2.04ms
matchers.py:_apply_leaf                                     400       0.21ms       1.32ms
_content_buckets.py:<genexpr>                              2330       1.27ms       1.27ms
matchers.py:_apply_regex                                    400       0.36ms       1.11ms
matchers.py:matches                                         200       0.22ms       1.06ms
_helpers.py:build_hit_from_match                            230       0.26ms       0.44ms
matchers.py:_extract_text                                   400       0.09ms       0.09ms
_content_buckets.py:<listcomp>                               22       0.02ms       0.02ms

================================================================================
=== 场景: S2 纯 CONTENT REGEX（50 条） ===
================================================================================

=== S2 纯 CONTENT REGEX（50 条） - perf_summary ===
总耗时: 822.85ms (0.8228s)
各阶段累计耗时: 781.72ms

阶段                                 总计       占比       调用次数           平均           最大
-----------------------------------------------------------------------------------
match                        775.50ms    94.2%        200       3.88ms      10.70ms
walk                           6.23ms     0.8%          1       6.23ms       6.23ms

扫描文件数: 200
命中规则数: 271
吞吐量: 243.1 files/s

=== cProfile 热点（cumulative time 前 25）===
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.823    0.823 scanner.py:502(scan)
        1    0.000    0.000    0.812    0.812 scanner.py:720(scan_entries)
        1    0.000    0.000    0.812    0.812 _pipeline_phase.py:48(run_pipeline_phase)
        1    0.001    0.001    0.812    0.812 _pipeline_phase.py:71(_scan_sequential)
      200    0.000    0.000    0.810    0.004 scanner.py:1207(_scan_entry)
      200    0.001    0.000    0.808    0.004 scanner.py:1240(_scan_entry_uncached)
      200    0.000    0.000    0.775    0.004 scanner.py:1112(_match_content_via_buckets_impl)
      200    0.623    0.003    0.775    0.004 _content_buckets.py:495(match_content_via_buckets)
      174    0.000    0.000    0.111    0.001 _content_buckets.py:465(_get_active_compiled)
       46    0.000    0.000    0.111    0.002 re.py:249(compile)
       46    0.001    0.000    0.111    0.002 re.py:288(_compile)
       46    0.000    0.000    0.110    0.002 sre_compile.py:783(compile)
       46    0.000    0.000    0.055    0.001 sre_compile.py:622(_code)
       46    0.000    0.000    0.054    0.001 sre_parse.py:944(parse)
  1529/46    0.003    0.000    0.054    0.001 sre_parse.py:436(_parse_sub)
  5180/46    0.016    0.000    0.053    0.001 sre_compile.py:87(_compile)
 2772/798    0.020    0.000    0.053    0.000 sre_parse.py:494(_parse)
      174    0.003    0.000    0.034    0.000 _content_buckets.py:442(_compute_active_indices)
     8185    0.002    0.000    0.034    0.000 {built-in method builtins.any}
    23322    0.029    0.000    0.029    0.000 _content_buckets.py:460(<genexpr>)
     2769    0.023    0.000    0.027    0.000 sre_compile.py:292(_optimize_charset)
      200    0.000    0.000    0.019    0.000 _helpers.py:271(default_extract_content)
      200    0.000    0.000    0.019    0.000 base.py:483(extract_content_with_fallback)
      200    0.000    0.000    0.019    0.000 base.py:465(extract_content)
      200    0.000    0.000    0.019    0.000 base.py:275(extract)



=== 重点函数明细（按 fullname 部分匹配）===
函数                                                       ncalls      tottime      cumtime
-----------------------------------------------------------------------------------------
scanner.py:_match_content_via_buckets_impl                  200       0.22ms     775.02ms
_content_buckets.py:match_content_via_buckets               200     623.36ms     774.80ms
_content_buckets.py:_get_active_compiled                    174       0.25ms     111.28ms
_content_buckets.py:_compute_active_indices                 174       2.64ms      34.01ms
_content_buckets.py:<genexpr>                             23322      29.31ms      29.31ms
_content_buckets.py:<genexpr>                              4413       2.81ms       2.81ms
_helpers.py:build_hit_from_match                            271       0.21ms       0.41ms
_content_buckets.py:<listcomp>                               46       0.05ms       0.05ms

================================================================================
=== 场景: S3 AND 组合（50 条 × 2~3 CONTENT 子项） ===
================================================================================

=== S3 AND 组合（50 条 × 2~3 CONTENT 子项） - perf_summary ===
总耗时: 1174.46ms (1.1745s)
各阶段累计耗时: 1109.02ms

阶段                                 总计       占比       调用次数           平均           最大
-----------------------------------------------------------------------------------
match                       1102.50ms    93.9%      10000       0.11ms       0.46ms
walk                           6.53ms     0.6%          1       6.53ms       6.53ms

扫描文件数: 200
命中规则数: 35
吞吐量: 170.3 files/s

=== cProfile 热点（cumulative time 前 25）===
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    1.174    1.174 scanner.py:502(scan)
        1    0.000    0.000    1.163    1.163 scanner.py:720(scan_entries)
        1    0.000    0.000    1.163    1.163 _pipeline_phase.py:48(run_pipeline_phase)
        1    0.001    0.001    1.163    1.163 _pipeline_phase.py:71(_scan_sequential)
      200    0.000    0.000    1.161    0.006 scanner.py:1207(_scan_entry)
      200    0.009    0.000    1.159    0.006 scanner.py:1240(_scan_entry_uncached)
    10000    0.006    0.000    1.094    0.000 matchers.py:183(matches)
    11010    0.007    0.000    1.084    0.000 matchers.py:117(matches)
    11010    0.003    0.000    1.069    0.000 matchers.py:364(_apply_leaf)
    11010    0.006    0.000    1.066    0.000 matchers.py:305(_apply_regex)
    31012    0.974    0.000    0.987    0.000 {built-in method builtins.next}
     1052    0.000    0.000    0.080    0.000 {built-in method builtins.sum}
     1225    0.080    0.000    0.080    0.000 matchers.py:315(<genexpr>)
      200    0.000    0.000    0.019    0.000 _helpers.py:271(default_extract_content)
      200    0.000    0.000    0.019    0.000 base.py:483(extract_content_with_fallback)
      200    0.000    0.000    0.019    0.000 base.py:465(extract_content)
      200    0.000    0.000    0.019    0.000 base.py:275(extract)
      200    0.000    0.000    0.018    0.000 text.py:153(extract)
    10001    0.003    0.000    0.015    0.000 contextlib.py:139(__exit__)
    20002    0.006    0.000    0.013    0.000 perf.py:405(measure)
      200    0.006    0.000    0.011    0.000 _helpers.py:240(is_minified_content)
      200    0.000    0.000    0.010    0.000 pathlib.py:1122(read_bytes)
      403    0.000    0.000    0.008    0.000 pathlib.py:1092(stat)
      403    0.008    0.000    0.008    0.000 {built-in method nt.stat}
        1    0.000    0.000    0.007    0.007 scanner.py:540(collect_entries)



=== 重点函数明细（按 fullname 部分匹配）===
函数                                                       ncalls      tottime      cumtime
-----------------------------------------------------------------------------------------
matchers.py:matches                                       10000       6.06ms    1094.21ms
matchers.py:matches                                       11010       7.31ms    1084.05ms
matchers.py:_apply_leaf                                   11010       2.81ms    1068.74ms
matchers.py:_apply_regex                                  11010       6.41ms    1065.94ms
matchers.py:<genexpr>                                      1225      80.04ms      80.04ms
matchers.py:_extract_text                                 11010       1.75ms       2.75ms
_helpers.py:build_hit_from_match                             35       0.05ms       0.07ms
matchers.py:_dedup_preserve_order                            35       0.06ms       0.07ms

================================================================================
=== 场景对比 ===
场景                                                    耗时(s)       文件/秒        命中数
--------------------------------------------------------------------------------
S1 内置规则（14 条）                                        1.2442      160.7        230
S2 纯 CONTENT REGEX（50 条）                             0.8228      243.1        271
S3 AND 组合（50 条 × 2~3 CONTENT 子项）                     1.1745      170.3         35
