当前位置:首页>python>Python itertools模块详细介绍

Python itertools模块详细介绍

  • 2026-02-02 19:58:49
Python itertools模块详细介绍

1. 创始时间与作者

  • 创始时间itertools 模块作为 Python 标准库的一部分,最初在 Python 2.3 版本中引入(2003年7月发布)

  • 核心开发者

    • Raymond Hettinger:Python 核心开发者,itertools 模块的主要设计和实现者

    • Python 核心团队:包括 Guido van Rossum 等对模块进行持续改进

  • 项目定位:Python 标准库中的迭代器工具集,提供高效的内存友好的迭代器操作,用于创建和操作迭代器

2. 官方资源

  • Python 文档地址https://docs.python.org/3/library/itertools.html

  • 源代码位置https://github.com/python/cpython/blob/main/Lib/itertools.py

  • Python 官方网站https://www.python.org/

3. 核心功能

4. 应用场景

1. 数据处理和转换
import itertools# 连接多个迭代器list1 = [123]list2 = [456]list3 = [789]combined = list(itertools.chain(list1list2list3))print(f"连接结果: {combined}")  # 输出: [1, 2, 3, 4, 5, 6, 7, 8, 9]# 分组操作data = [('a'1), ('a'2), ('b'3), ('b'4), ('c'5)]grouped = {}for keygroup in itertools.groupby(datalambda xx[0]):grouped[key] = list(group)print(f"分组结果: {grouped}")
2. 组合数学计算
import itertools# 排列计算items = ['A''B''C']permutations = list(itertools.permutations(items2))print(f"排列结果 (P(3,2)): {permutations}")# 输出: [('A', 'B'), ('A', 'C'), ('B', 'A'), ('B', 'C'), ('C', 'A'), ('C', 'B')]# 组合计算combinations = list(itertools.combinations(items2))print(f"组合结果 (C(3,2)): {combinations}")# 输出: [('A', 'B'), ('A', 'C'), ('B', 'C')]# 笛卡尔积colors = ['红''蓝']sizes = ['S''M''L']products = list(itertools.product(colorssizes))print(f"笛卡尔积: {products}")# 输出: [('红', 'S'), ('红', 'M'), ('红', 'L'), ('蓝', 'S'), ('蓝', 'M'), ('蓝', 'L')]
3. 高效循环和迭代
import itertools# 无限计数器counter = itertools.count(start=10step=2)print("计数器示例:")for in range(5):print(next(counter))  # 输出: 10, 12, 14, 16, 18# 循环迭代器cycler = itertools.cycle(['A''B''C'])print("循环器示例:")for in range(6):print(next(cycler))  # 输出: A, B, C, A, B, C# 重复生成器repeater = itertools.repeat('Hello'3)print("重复器示例:")print(list(repeater))  # 输出: ['Hello', 'Hello', 'Hello']
4. 高级数据筛选
import itertools# 数据压缩筛选names = ['Alice''Bob''Charlie''David']scores = [85927890]passed = [TrueTrueFalseTrue]# 使用compress进行条件筛选passed_students = itertools.compress(namespassed)print(f"通过学生: {list(passed_students)}")  # 输出: ['Alice', 'Bob', 'David']# 使用dropwhile和takewhilenumbers = [1352461]print("大于2之前的数字:")print(list(itertools.takewhile(lambda xx<2numbers)))  # 输出: [1]print("大于2之后的数字:")print(list(itertools.dropwhile(lambda xx<2numbers)))  # 输出: [3, 5, 2, 4, 6, 1]# 使用filterfalse获取不满足条件的元素odd_numbers = list(itertools.filterfalse(lambda xx%2 == 0range(10)))print(f"奇数: {odd_numbers}")  # 输出: [1, 3, 5, 7, 9]

5. 底层逻辑与技术原理

核心架构
关键技术
  1. 生成器实现

    • 使用 Python 生成器实现惰性求值

    • 只在需要时计算下一个值,节省内存

    • 支持大规模数据处理

  2. 迭代器协议

    • 实现 __iter__() 和 __next__() 方法

    • 支持标准的迭代操作和 for 循环

    • 可与所有迭代工具兼容

  3. 算法优化

    • 使用高效的数学算法实现组合操作

    • 优化常见迭代模式的内存使用

    • 提供 C 语言实现的加速版本

  4. 函数式编程

    • 支持函数式编程风格

    • 可与 lambda 函数和内置函数结合使用

    • 提供无副作用的纯函数操作


6. 安装与配置

安装说明
# itertools 是 Python 标准库的一部分,无需单独安装# 从 Python 2.3+ 开始内置支持# 检查 Python 版本python --version# 导入测试python -c"import itertools; print('itertools 模块可用')"
版本兼容性
Python 版本itertools 功能支持
2.3+基本迭代器功能
2.6+更多组合函数
3.0+更好的性能优化
3.1+accumulate 函数
3.3+accumulate 支持 func 参数
3.10+pairwise 函数
依赖关系
  • 必需依赖:无(Python 标准库组件)

  • 可选增强

    • 无额外依赖,纯 Python 实现

环境要求
组件最低要求推荐配置
Python2.3+3.8+
内存极低(惰性求值)无特殊要求
性能基础性能无特殊要求

7. 性能特点

功能内存使用性能说明
无限迭代器常数内存极高只存储状态,不存储数据
有限迭代器常数内存惰性处理输入迭代器
组合生成器取决于算法中等数学计算复杂度较高
数据处理极低流水线处理,无中间存储

注:性能特征基于典型使用场景,itertools 的主要优势是内存效率而非绝对速度


8. 高级功能使用

1. 累积计算
import itertoolsimport operator# 基本累积计算numbers = [12345]cumulative_sum = list(itertools.accumulate(numbers))print(f"累积和: {cumulative_sum}")  # 输出: [1, 3, 6, 10, 15]# 使用自定义函数cumulative_product = list(itertools.accumulate(numbersoperator.mul))print(f"累积积: {cumulative_product}")  # 输出: [1, 2, 6, 24, 120]# 复杂累积操作def running_max(accval):return max(accval)max_so_far = list(itertools.accumulate(numbersrunning_max))print(f"运行最大值: {max_so_far}")  # 输出: [1, 2, 3, 4, 5]
2. 迭代器切片和窗口
import itertools# 迭代器切片(类似于列表切片但更高效)def iterator_slice(iterablestartstop=Nonestep=1):"""对迭代器进行切片操作"""if stop is None:stop = startstart = 0it = iter(iterable)# 跳过开始部分itertools.islice(itstartNone)# 返回切片return itertools.islice(it0stop-startstep)# 使用示例numbers = range(100)  # 大范围,但内存友好sliced = iterator_slice(numbers10202)print(f"切片结果: {list(sliced)}")  # 输出: [10, 12, 14, 16, 18]# 滑动窗口def sliding_window(iterablesize=2):"""生成滑动窗口"""iters = itertools.tee(iterablesize)for iit in enumerate(iters):itertools.islice(itiNone)return zip(*iters)# 使用示例data = [12345]windows = list(sliding_window(data3))print(f"滑动窗口: {windows}")  # 输出: [(1, 2, 3), (2, 3, 4), (3, 4, 5)]
3. 高级组合模式
import itertools# 多重笛卡尔积def multi_product(*iterablesrepeat=1):"""生成多重笛卡尔积"""pools = [tuple(poolfor pool in iterables*repeatresult = [[]]for pool in pools:result = [x+ [yfor in result for in pool]return result# 使用示例result = multi_product([12], ['a''b'], repeat=1)print(f"多重笛卡尔积: {result}")# 组合与排列的扩展def powerset(iterable):"""生成集合的幂集"""s = list(iterable)return itertools.chain.from_iterable(itertools.combinations(srfor in range(len(s+1)    )# 使用示例items = ['A''B''C']all_subsets = list(powerset(items))print(f"幂集: {all_subsets}")# 输出: [(), ('A',), ('B',), ('C',), ('A', 'B'), ('A', 'C'), ('B', 'C'), ('A', 'B', 'C')]
4. 迭代器调试和监控
import itertoolsdef debug_iterator(iterablename="iterator"):"""调试迭代器,记录每个值的产生"""for iitem in enumerate(iterable):print(f"{name}[{i}] = {item}")yield item# 使用示例numbers = [12345]debugged = debug_iterator(numbers"numbers")# 正常的迭代操作sum_result = sum(itertools.islice(debugged3))print(f"前三个数的和: {sum_result}")# 迭代器状态检查def iterator_info(iterator):"""获取迭代器信息(不消耗迭代器)"""# 使用 tee 来窥视而不消耗peekoriginal = itertools.tee(iterator)try:first = next(peek)# 计算长度(会消耗副本)length = 1+sum(for in peek)return {"has_items"True"first_item"first"length"length}except StopIteration:return {"has_items"False"first_item"None"length"0}# 使用示例it = iter([102030])info = iterator_info(it)print(f"迭代器信息: {info}")# 仍然可以正常使用原迭代器print(f"第一个元素: {next(it)}")

9. 与相关工具对比

特性itertools手动循环列表推导式NumPy
内存效率⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
代码简洁性⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
功能丰富度⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
学习曲线⭐⭐⭐⭐⭐⭐⭐⭐⭐
性能⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
适用场景通用迭代简单循环简单转换数值计算

10. 最佳实践案例

  1. 大数据处理

    import itertoolsimport gzipdef process_large_file(filename):"""处理大型文件,内存高效"""with gzip.open(filename'rt'as f:# 使用 islice 分批处理batch_size = 1000batch_num = 0while True:# 读取一批行batch = list(itertools.islice(fbatch_size))if not batch:break# 处理批次process_batch(batchbatch_num)batch_num += 1def process_batch(linesbatch_num):"""处理单个批次"""print(f"处理批次 {batch_num}, 行数: {len(lines)}")# 实际处理逻辑...
  2. 数据分析管道

    import itertoolsimport csvdef data_analysis_pipeline(filename):"""数据分析管道"""with open(filename'r'as f:reader = csv.reader(f)# 跳过标题行data = itertools.islice(reader1None)# 过滤无效数据valid_data = itertools.filterfalse(lambda rownot row or row[0].startswith('#'), data)# 分组分析grouped = itertools.groupby(valid_datalambda rowrow[2])  # 按第三列分组for keygroup in grouped:group_list = list(group)print(f"类别 {key}: {len(group_list)} 条记录")# 进一步分析...
  3. 生成测试数据

    import itertoolsimport randomdef generate_test_data():"""生成组合测试数据"""# 参数组合params = {'mode': ['train''test''validate'],'batch_size': [3264128],'learning_rate': [0.10.010.001]    }# 生成所有组合keys = params.keys()values = params.values()for combination in itertools.product(*values):config = dict(zip(keyscombination))# 添加一些随机变化config['dropout'] = random.uniform(0.10.5)yield config# 使用示例for iconfig in enumerate(itertools.islice(generate_test_data(), 5)):print(f"测试配置 {i}: {config}")
  4. 实时数据流处理

    import itertoolsimport timedef real_time_data_stream():"""模拟实时数据流处理"""# 无限数据流data_stream = (random.randint(1100)  for in itertools.count())# 滑动窗口分析window_size = 5windows = sliding_window(data_streamwindow_size)for iwindow in enumerate(itertools.islice(windows10)):avg = sum(windowwindow_sizeprint(f"窗口 {i}: {window}, 平均值: {avg:.2f}")time.sleep(0.1)  # 模拟实时延迟

总结

itertools 是 Python 迭代器编程的核心工具集,核心价值在于:

  1. 内存高效:惰性求值避免中间存储,适合处理大规模数据

  2. 功能强大:提供丰富的迭代器操作和组合数学功能

  3. 代码简洁:用声明式代码替代复杂的循环逻辑

  4. 性能优良:优化的算法实现和C语言加速

技术亮点

  • 基于生成器的惰性求值实现

  • 丰富的数学组合功能

  • 无缝集成Python迭代协议

  • 纯函数式无副作用操作

适用场景

  • 大规模数据处理和分析

  • 组合数学和算法实现

  • 数据流和实时处理

  • 测试数据生成

  • 函数式编程应用

使用方式

import itertools# Python 标准库,无需安装

学习资源

  • 官方文档:https://docs.python.org/3/library/itertools.html

  • 深入教程:Real Python itertools 指南https://realpython.com/python-itertools/

  • 实例教程:itertools 秘籍https://docs.python.org/3/library/itertools.html#itertools-recipes

作为 Python 标准库的一部分,itertools 模块是高效迭代器编程的必备工具,遵循 Python 软件基金会许可证,可免费用于任何 Python 项目。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 13:58:02 HTTP/2.0 GET : https://f.mffb.com.cn/a/468139.html
  2. 运行时间 : 0.181853s [ 吞吐率:5.50req/s ] 内存消耗:4,733.66kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=3262751aaf4c538596432d330564e3f0
  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.000391s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000500s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.002082s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.002341s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000575s ]
  6. SELECT * FROM `set` [ RunTime:0.000243s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000603s ]
  8. SELECT * FROM `article` WHERE `id` = 468139 LIMIT 1 [ RunTime:0.009692s ]
  9. UPDATE `article` SET `lasttime` = 1770530282 WHERE `id` = 468139 [ RunTime:0.006558s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000278s ]
  11. SELECT * FROM `article` WHERE `id` < 468139 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.002306s ]
  12. SELECT * FROM `article` WHERE `id` > 468139 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.002052s ]
  13. SELECT * FROM `article` WHERE `id` < 468139 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.003387s ]
  14. SELECT * FROM `article` WHERE `id` < 468139 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.037442s ]
  15. SELECT * FROM `article` WHERE `id` < 468139 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.007814s ]
0.183318s