SA 实体/特效的重复 AABB 全量实体扫描与 O(n²) 已命中列表(Drive 模板通病) #1

Closed
opened 2026-09-03 14:50:37 +00:00 by layue13 · 1 comment
Owner

问题描述

EntityDriveEx(entity/EntityDriveEx.java:151-215):每 tick 先 DestructableSelector 扫描(AttackableSelector 每 2 tick),alreadyHitEntity ArrayList 线性 removeAll(O(n²));:187 每命中实体 10 次 spawnParticle。LightningSwords(specialattack/LightningSwords.java:82-100):count=3+StylishRank(上限约 13),循环生成同数量 EntityPhantomSwordEx,每把又带同样的每 tick 扫描逻辑;:122 getEntityToWatch 10 轮逐步扩大 AABB 全量扫描(每轮含掉落物/经验球等全部实体)。
建议:已命中集合按 EntityId 用 Set;getEntityToWatch 单次扩大 AABB 扫描替代 10 轮;批量召唤实体数与 stylish rank 解耦或设上限。

### 问题描述 **EntityDriveEx**(entity/EntityDriveEx.java:151-215):每 tick 先 DestructableSelector 扫描(AttackableSelector 每 2 tick),alreadyHitEntity ArrayList 线性 removeAll(O(n²));:187 每命中实体 10 次 spawnParticle。**LightningSwords**(specialattack/LightningSwords.java:82-100):count=3+StylishRank(上限约 13),循环生成同数量 EntityPhantomSwordEx,每把又带同样的每 tick 扫描逻辑;:122 getEntityToWatch 10 轮逐步扩大 AABB 全量扫描(每轮含掉落物/经验球等全部实体)。 建议:已命中集合按 EntityId 用 Set;getEntityToWatch 单次扩大 AABB 扫描替代 10 轮;批量召唤实体数与 stylish rank 解耦或设上限。
Author
Owner

Archive 组织仓已过时(Daniel 2026-09-23),整组织 issue 统一关闭。

Archive 组织仓已过时(Daniel 2026-09-23),整组织 issue 统一关闭。
layue13 added the
type
perf
priority
p2
labels 2026-10-06 21:07:43 +00:00
layue13 changed title from [性能][中] SA 实体/特效的重复 AABB 全量实体扫描与 O(n²) 已命中列表(Drive 模板通病) to SA 实体/特效的重复 AABB 全量实体扫描与 O(n²) 已命中列表(Drive 模板通病) 2026-10-06 21:07:43 +00:00
This repo is archived. You cannot comment on issues.
No labels
priority
p2
type
perf
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Archive/slashblade-kamuy#1