当前位置:首页>python>Python高频面试问答(3):内存并发与OOP设计

Python高频面试问答(3):内存并发与OOP设计

  • 2026-06-29 14:26:38
Python高频面试问答(3):内存并发与OOP设计

Python编程基础·面试精华(三):内存并发与OOP设计

第1章 编程基础:Python · Part 3/5

涵盖内存管理与性能(5问)、并发编程(5问)、OOP设计思想(7问),共17个高频面试问答。

(接上篇)这一篇我们进入 Python 面试中硬核的两大块:内存管理与并发编程、面向对象设计思想,包括深拷贝浅拷贝、垃圾回收、循环引用、 内存泄漏、GIL、多进程、线程池共 17 个高频问答。这里应该是Python部分最重要、最高频的模块之一。

五、内存管理与性能

31. Python的深拷贝与浅拷贝?

在Python中,赋值 a = b 只是增加了对象的引用计数,a 和 b 指向同一个对象

浅拷贝(Shallow Copy)

创建一个新对象,但内部元素仍然引用原对象的子对象

PYTHON

import copy

a = [[1, 2], [3, 4]]

b = copy.copy(a)        # 浅拷贝

print(a is b)           # False(外层容器不同)

print(a[0] is b[0])     # True!(内层子对象相同)

# 修改内层子对象会影响双方

a[0][0] = 999

print(b[0][0])          # 999(b也受到影响!)

常见的浅拷贝方式list()dict()copy.copy()、切片 [:]

深拷贝(Deep Copy)

递归地拷贝所有子对象,新旧对象完全独立

PYTHON

a = [[1, 2], [3, 4]]

c = copy.deepcopy(a)    # 深拷贝

print(a is c)           # False

print(a[0] is c[0])     # False(内层子对象也不同!)

a[0][0] = 999

print(c[0][0])          # 1(c不受影响)

选择指南

方法
场景
赋值 =
需要共享对象时
浅拷贝
对象只包含不可变元素(int, str, tuple),不需要独立子对象
深拷贝
对象包含可变子对象且需要完全独立于原对象

32. Python的垃圾回收机制

Python使用三种机制协同管理内存:

1. 引用计数(主机制)

  • 每个对象维护一个引用计数。
  • 引用计数降为0时,对象被立即回收。
  • 优点
    :实时、确定性强。
  • 缺点
    :无法处理循环引用,维护计数有开销。

2. 标记-清除(处理循环引用)

  • 定期启动,标记所有可达对象,清除不可达对象。
  • 处理引用计数无法解决的循环引用问题。

3. 分代回收(提升效率)

  • 对象分为三代(0代 → 1代 → 2代)。
  • 新对象在0代,存活越久的对象代数越高。
  • 主要扫描0代(年轻对象),因为大多数对象生命周期短。
  • 可通过 gc 模块调整阈值:
PYTHON

import gc

print(gc.get_threshold())  # 默认 (700, 10, 10)

gc.set_threshold(1000, 10, 5)  # 自定义阈值

gc.collect()               # 手动触发垃圾回收


33. Python中引用计数原理与循环引用

引用计数规则

PYTHON

import sys

a = [1, 2, 3]           # 引用计数 = 1

b = a                   # 引用计数 = 2

del b                   # 引用计数 = 1

c = {'key': a}          # 引用计数 = 2

del c['key']            # 引用计数 = 1

del a                   # 引用计数 = 0 → 对象被销毁

sys.getrefcount(obj) 可查看引用计数(结果比实际多1,因为调用本身增加了一个临时引用)。

循环引用问题

PYTHON

class Node:

def __init__(self, value):

self.value = value

self.next = None

node1 = Node(1)

node2 = Node(2)

node1.next = node2

node2.next = node1    # 循环引用!

del node1

del node2

# 此时两个对象的引用计数都不为0(互相引用)

# — 只能由垃圾回收器的标记-清除机制处理

解决方案

PYTHON

# 1. 手动断开

node1.next = None

node2.next = None

# 2. 使用弱引用

import weakref

node1.next = weakref.ref(node2)  # 弱引用不增加引用计数

# 3. 手动触发GC

import gc

gc.collect()


34. Python中什么情况下会产生内存泄漏?

虽然Python有自动垃圾回收,以下情况仍可导致内存泄漏:

场景
原因
解决方案
循环引用
两个对象互相引用,引用计数永不归零
使用 weakref;手动断开引用
全局变量/缓存无限增长
数据只增不减
使用 functools.lru_cache(maxsize=N);定期清理
未释放外部资源
文件、网络连接、数据库连接未关闭
使用 with 语句
闭包持有大对象
闭包捕获了外部大变量
确保闭包不持有不必要的引用
C扩展泄漏
第三方C扩展手动管理内存不当
检查库文档,及时 del + gc.collect()
__del__ 异常
析构函数抛出异常,对象无法被GC回收
确保 __del__ 不会抛出异常

检测工具

PYTHON

import tracemalloc

tracemalloc.start()

# ... 运行代码 ...

snapshot = tracemalloc.take_snapshot()

top_stats = snapshot.statistics('lineno')

for stat in top_stats[:10]:

print(stat)


35. 有哪些提高Python运行效率的方法?

代码层面

PYTHON

# 1. 使用推导式代替循环

squares = [i**2 for i in range(1000)]  # 比 for+append 快

# 2. 字符串拼接用 join 而非 +

result = ''.join(list_of_strings)       # 比 += 快

# 3. 使用局部变量(访问更快)

def fast():

    local_var = global_var   # 缓存在局部

for i in range(1000):

        process(local_var)

# 4. 使用生成器处理大数据(节省内存)

sum(x**2 for x in range(10**8))

# 5. 合理使用集合/字典进行查找(O(1) vs 列表的O(n))

valid = set(['a', 'b', 'c'])

if item in valid:   # O(1)

pass

工具层面

工具
用途
NumPy/Pandas
高效数值计算(底层C实现,向量化操作)
Cython
将Python代码编译为C扩展
Numba
JIT编译,加速数值计算
多进程multiprocessing
 绕开GIL,适合CPU密集型
异步编程asyncio
 适合I/O密集型高并发
PyPy
带JIT的替代Python解释器

性能分析工具

BASH

# cProfile:标准库性能分析器

python -m cProfile -o output.prof script.py

# line_profiler:逐行分析

# memory_profiler:内存分析


六、并发编程

36. Python里的多线程与全局解释器锁GIL

GIL(Global Interpreter Lock)

GIL是CPython解释器中的一个互斥锁,保证同一时刻只有一个线程执行Python字节码。

为什么需要GIL?

  • CPython的内存管理使用引用计数。如果两个线程同时修改同一个对象的引用计数(如 a = b 操作),可能导致计数错乱。加锁保护每个引用计数操作太慢,于是用一个全局锁。
  • 保护CPython内部数据结构,简化了解释器的实现。

GIL的释放时机(这是理解"什么时候用线程"的关键)

时机
说明
I/O 操作
socket.read()
time.sleep()file.read() — 解释器主动释放 GIL,让其他线程运行
超时到期
Python 3.2+ 基于超时机制:线程持有 GIL 约 5ms 后强制释放(sys.setswitchinterval 可调)
C 扩展
NumPy 等 C 扩展在执行计算前可以通过 Py_BEGIN_ALLOW_THREADS 显式释放 GIL

I/O密集多线程有效的原理:线程 A 发网络请求 → 主动释放 GIL → 线程 B 获得 GIL 发第二个请求 → B 也释放 GIL → A 的 I/O 完成后重新获取 GIL。虽然只有一个核跑 Python,但 I/O 等待期间可以切换,多个 I/O 操作在"并行等待"。

GIL的影响

任务类型
GIL影响
推荐方案
I/O密集型
影响小(I/O等待时释放GIL)
多线程 ✅
CPU密集型
严重影响(无法利用多核)
多进程 ✅
PYTHON

# I/O密集型:多线程有效

import threading

def io_task():

    # 网络请求等I/O操作

    time.sleep(1)  # 此时GIL被释放

# CPU密集型:多线程无效,应用多进程

from multiprocessing import Pool

def cpu_task(n):

return sum(i * i for i in range(n))

with Pool(4) as p:

    results = p.map(cpu_task, [10**6] * 10)

绕过GIL的方法

  1. 多进程
    multiprocessingconcurrent.futures.ProcessPoolExecutor
  2. 使用C扩展
    (NumPy等底层C代码可在持有GIL时释放)
  3. 使用其他Python实现
    :Jython(JVM)、IronPython(.NET)无 GIL;Python 3.13 起实验性支持 free-threaded 模式(编译选项 --disable-gil),3.14 正式支持(2025年10月发布)。代价:单线程性能下降约 10%,引用计数改用线程安全的偏置引用计数
  4. 异步编程
    asyncio 单线程协程,不是真正并行但高效处理 I/O)

asyncio 事件循环机制asyncio 在单线程中通过事件循环调度协程。每次 await 让出控制权,事件循环检查哪些 I/O 已完成(通过操作系统的 epoll/kqueue/IOCP),恢复对应的协程。本质是协作式多任务——协程主动 await 让出,而非操作系统抢占式调度。这使得 asyncio 能处理数万并发连接,但单个协程中的 CPU 密集操作会阻塞整个事件循环——解法是 await asyncio.to_thread(cpu_task) 丢给线程池。

Python 并发选型指南

CODE

CPU 密集型 → 多进程(multiprocessing)或 C 扩展(NumPy/Numba)

I/O 密集型

  ├── 并发 < 100,逻辑简单 → 多线程(threading)

  └── 并发 > 1000 → asyncio(协程)

      1000 线程也可跑但上下文切换开销大,不如协程高效


37. Python多进程中的fork和spawn模式有什么区别?

维度
fork
spawn
原理
复制父进程的完整内存空间
启动全新的Python解释器进程
启动速度
快(写时复制)
慢(需重新初始化)
资源继承
继承父进程所有资源(文件描述符、锁等)
只继承 run() 所需的资源
安全性
多线程程序中可能死锁
更安全
平台支持
Unix/Linux(默认)
Windows(默认)、MacOS(默认)、Unix
Windows支持
❌ 不支持
PYTHON

import multiprocessing as mp

# 在Unix上可以设置启动方式

mp.set_start_method('fork')   # 或 'spawn'、'forkserver'

# 推荐:用 spawn 确保跨平台兼容

if __name__ == '__main__':

    mp.set_start_method('spawn', force=True)


38. 线程池与进程池的区别是什么?

维度
线程池
进程池
适用任务
I/O密集型
CPU密集型
受GIL影响
✅ 受限
❌ 不受限
资源共享
线程间共享内存
进程间不共享(独立内存空间)
上下文切换开销
较小
较大
创建销毁开销
较小
较大
通信方式
共享内存(简单)
管道、队列等IPC(复杂)
Python实现concurrent.futures.ThreadPoolExecutorconcurrent.futures.ProcessPoolExecutor
multiprocessing.Pool

选择指南

  • 网络爬虫、文件读写、API调用 → 线程池
  • 图像处理、数学计算、模型训练 → 进程池

39. multiprocessing模块怎么使用?

multiprocessing 模块的核心组件:

PYTHON

from multiprocessing import Process, Pool, Queue, Pipe, Lock, Manager

import time

# 1. Process:创建独立进程

def worker(name):

print(f'Worker {name} started')

    time.sleep(1)

print(f'Worker {name} finished')

if __name__ == '__main__':

    p = Process(target=worker, args=('A',))

    p.start()

    p.join()  # 等待进程结束

# 2. Pool:进程池并发

def square(x):

return x * x

if __name__ == '__main__':

with Pool(4) as p:

        results = p.map(square, [1, 2, 3, 4, 5, 6])

print(results)  # [1, 4, 9, 16, 25, 36]

# 3. Queue:进程间安全通信

def producer(q):

    q.put('Hello from child process')

if __name__ == '__main__':

    q = Queue()

    p = Process(target=producer, args=(q,))

    p.start()

print(q.get())  # 主进程收取数据

    p.join()

# 4. Manager:共享复杂Python对象

def update(shared_dict, key, value):

    shared_dict[key] = value

if __name__ == '__main__':

with Manager() as manager:

        shared_dict = manager.dict()

        processes = [Process(target=update, args=(shared_dict, i, i*i)) for i in range(4)]

for p in processes:

            p.start()

for p in processes:

            p.join()

print(shared_dict)  # {0: 0, 1: 1, 2: 4, 3: 9}

关键组件速查ProcessPoolQueuePipeLockSemaphoreEventValueArrayManager


40. ProcessPoolExecutor怎么使用?

concurrent.futures.ProcessPoolExecutor 提供了比 multiprocessing.Pool 更高级的接口。

PYTHON

from concurrent.futures import ProcessPoolExecutor

import time

def cpu_task(n):

    time.sleep(1)  # 模拟计算

return n * n

if __name__ == '__main__':

    numbers = [1, 2, 3, 4, 5, 6, 7, 8]

with ProcessPoolExecutor(max_workers=4) as executor:

        # 方法1:submit + Future

        futures = [executor.submit(cpu_task, num) for num in numbers]

        results = [f.result() for f in futures]

        # 方法2:map(保持输入顺序)

        results = list(executor.map(cpu_task, numbers))

print(results)  # [1, 4, 9, 16, 25, 36, 49, 64]

ProcessPoolExecutor vs multiprocessing.Pool

特性
ProcessPoolExecutor
multiprocessing.Pool
接口一致性
与ThreadPoolExecutor一致
独立接口
抽象层次
高(简单)
低(灵活)
结果获取
Future.result()
回调函数/手动检查
推荐场景
常规并行任务
需要精细控制的场景

七、OOP设计思想

41. Python中的封装(Encapsulation)思想

封装是面向对象编程的核心原则之一,通过隐藏内部实现细节,只暴露必要的接口。

Python中的访问控制(依赖命名约定)

类型
命名规则
访问限制
公有(Public)name
外部可直接访问
受保护(Protected)_name
约定不应直接访问,子类可访问
私有(Private)__name
通过名称重整(name mangling)变为 _ClassName__name
PYTHON

class BankAccount:

def __init__(self, owner, balance):

self.owner = owner       # 公有

self.__balance = balance  # 私有

@property

def balance(self):

        """getter:对外提供安全的访问方式"""

returnself.__balance

@balance.setter

def balance(self, amount):

        """setter:在修改时进行验证"""

if amount < 0:

raise ValueError("余额不能为负")

self.__balance = amount

account = BankAccount("Alice", 1000)

print(account.balance)      # 1000(通过property访问)

account.balance = 2000      # 通过setter修改

# account.__balance         # AttributeError!

注意:Python的"私有"并非强制隔离(可通过 account._BankAccount__balance 强行访问),这是一种"大家都是成年人"的设计哲学。


42. Python中的继承(Inheritance)思想

继承允许子类复用父类的属性和方法,同时可以扩展或重写。

基本继承

PYTHON

class Animal:

def __init__(self, name):

self.name = name

def speak(self):

pass

class Dog(Animal):

def speak(self):                    # 方法重写(Override)

return f"{self.name} says Woof!"

class Cat(Animal):

def speak(self):

return f"{self.name} says Meow!"

多重继承与MRO

Python 使用 C3 线性化算法计算 MRO(Method Resolution Order,方法解析顺序),决定多继承时属性查找的先后顺序。

核心原则:① 子类优先于父类 ② 父类顺序按定义从左到右 ③ 所有祖先只出现一次(在最后出现位置)。

菱形继承(Diamond Problem):当 D 继承 B 和 C,B 和 C 都继承 A——D 中应该只保留一份 A。C3 算法通过拓扑排序 + 一致性检查解决了这个问题:

PYTHON

class A:

def who(self): return "A"

class B(A):

def who(self): return "B"

class C(A):

def who(self): return "C"

class D(B, C):  # D 继承 B 和 C

pass

print(D.mro())       # D → B → C → A → object

print(D().who())     # "B" —— B 在 C 前面

super() 沿 MRO 链条调用下一个类,而不是固定调用"父类"。在 D 中调用 super() 会顺着 D→B→C→A 依次调用。这也是为什么 super() 在多继承中能正确工作——它是针对 MRO 的,不是针对父类的。

面试追问如果写 class D(C, B) 会怎样? MRO 变成 D→C→B→AD().who() 返回 "C"。顺序由定义时的基类排序决定,完全不同。

PYTHON

class Person:

def __init__(self, name):

self.name = name

class Employee(Person):

def __init__(self, name, employee_id):

super().__init__(name)          # 调用父类__init__

self.employee_id = employee_id


43. Python中的多态(Polymorphism)思想

多态允许不同类的对象对同一消息做出不同的响应,即"一个接口,多种实现"。

PYTHON

# Python的鸭子类型(Duck Typing):

# "如果它走起来像鸭子,叫起来像鸭子,那它就是鸭子"

class Dog:

def speak(self):

return "Woof!"

class Cat:

def speak(self):

return "Meow!"

class Duck:

def speak(self):

return "Quack!"

# 多态:统一的接口,不同的行为

def animal_sound(animal):

print(animal.speak())

animal_sound(Dog())   # Woof!

animal_sound(Cat())   # Meow!

animal_sound(Duck())  # Quack!

鸭子类型:Python不要求对象继承自特定基类,只要对象实现了所需的方法(如 speak()),就能以多态方式使用。这比强类型语言的接口/抽象类更加灵活。


44. Python中的耦合和解耦的代码设计思想

耦合(Coupling):模块间的依赖程度。高耦合意味着一个模块的修改会牵动其他模块。

解耦(Decoupling):降低模块间的依赖,使系统更易于维护和扩展。

解耦的三种常见方法

1. 依赖注入

PYTHON

class Database:

def connect(self):

print("Connecting to DB")

# 紧耦合:UserService 内部创建 Database

class UserService:

def __init__(self):

self.db = Database()        # ❌ 紧耦合

# 松耦合:从外部注入依赖

class UserService:

def __init__(self, db):         # ✅ 依赖注入

self.db = db

2. 抽象接口

PYTHON

from abc import ABC, abstractmethod

class DatabaseInterface(ABC):

@abstractmethod

def connect(self):

pass

class MySQLDatabase(DatabaseInterface):

def connect(self):

print("Connecting to MySQL")

class UserService:

def __init__(self, db: DatabaseInterface):  # 面向接口编程

self.db = db

3. 事件驱动架构

PYTHON

class EventBus:

def __init__(self):

self.listeners = []

def subscribe(self, listener):

self.listeners.append(listener)

def publish(self, event):

for listener in self.listeners:

            listener(event)


45. Python中有哪些常用的设计模式?

创建型模式

单例模式:确保一个类只有一个实例。

PYTHON

class Singleton:

    _instance = None

def __new__(cls, *args, **kwargs):

ifnotcls._instance:

cls._instance = super().__new__(cls)

returncls._instance

工厂方法模式:将对象创建延迟到子类。

PYTHON

class CarFactory:

def create_car(self, car_type):

if car_type == "sedan":

return Sedan()

elif car_type == "truck":

return Truck()

结构型模式

适配器模式:将一个类的接口转换为客户期望的另一个接口。

装饰器模式:动态地给对象添加职责(Python的 @decorator 语法本质就是装饰器模式)。

代理模式:为对象提供代理以控制访问(如延迟加载、访问控制)。

行为型模式

观察者模式:一对多依赖,状态变化时通知所有依赖者。

策略模式:定义一系列算法,使它们可以相互替换。

PYTHON

class CarStrategy:

def travel(self): pass

class TrainStrategy:

def travel(self): return "Traveling by train"

context = TravelContext(TrainStrategy())

context.travel()  # Traveling by train


46. Python的自省特性

自省(Introspection)是指程序在运行时检查对象类型、属性、方法等的能力。

PYTHON

type():获取对象类型

print(type(42))               # <class 'int'>

# dir():列出对象的所有属性和方法

print(dir([1, 2, 3]))

hasattr/getattr/setattr:动态操作属性

class Person:

    name = "Alice"

p = Person()

print(hasattr(p, 'name'))     # True

print(getattr(p, 'name'))     # Alice

setattr(p, 'age', 30)

isinstance/issubclass:检查继承关系

print(isinstance([], list))   # True

print(issubclass(boolint))  # True(bool是int的子类)

# __dict__:查看对象的属性字典

print(p.__dict__)              # {'age': 30}

# callable:检查是否可调用

print(callable(print))        # True

算法岗校招面试系列目前规划10+ 章 50+ 篇内容,涵盖 Python、C/C++、计网、数据结构、数字图像、机器学习、深度学习、大模型、Agent、算法题等所有算法岗面试核心模块。关注本号,第一时间收到更新。

#人工智能就业 #大模型 #校招面试  #算法面试 #Python

校招算法岗求职干货合集 · 第1章 编程基础:Python整理版共67个问答,本文为第 3/5 篇

📮 下期预告

下一篇:AI实战专题(上)

框架选型 · PyTorch vs TensorFlow · PIL vs OpenCV · 图像处理 · 多进程

共 11 个问答,周六 21:00 见。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 05:07:58 HTTP/2.0 GET : https://f.mffb.com.cn/a/501428.html
  2. 运行时间 : 0.100989s [ 吞吐率:9.90req/s ] 内存消耗:4,661.61kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=5552f4eafe0673931774f7f4203d4ae7
  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.000604s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000847s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000319s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000295s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000484s ]
  6. SELECT * FROM `set` [ RunTime:0.000212s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000509s ]
  8. SELECT * FROM `article` WHERE `id` = 501428 LIMIT 1 [ RunTime:0.000463s ]
  9. UPDATE `article` SET `lasttime` = 1783026478 WHERE `id` = 501428 [ RunTime:0.024827s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000406s ]
  11. SELECT * FROM `article` WHERE `id` < 501428 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000704s ]
  12. SELECT * FROM `article` WHERE `id` > 501428 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000430s ]
  13. SELECT * FROM `article` WHERE `id` < 501428 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001273s ]
  14. SELECT * FROM `article` WHERE `id` < 501428 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000864s ]
  15. SELECT * FROM `article` WHERE `id` < 501428 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001684s ]
0.102520s