Performance regression: v5 is 2–7× slower than v3.8.0 for local evaluation
@khvn26 已经在做这个了。
开始于 2026年4月28日。
评估
这个 Issue 还没有评估数据。
描述
Benchmarked flagsmith 5.0.1 vs 3.8.0 against the same environment (edge API, enable_local_evaluation=True, 262 features, single-threaded, after 200-iter warmup).
p50 per call
| Operation | v3.8.0 | v5.0.1 | Regression |
|---|---|---|---|
get_identity_flags |
0.39 ms | 0.82 ms | 2.1× |
get_environment_flags |
0.11 ms | 0.79 ms | 7.4× |
is_feature_enabled (cached Flags) |
0.08 µs | 0.08 µs | — |
Throughput drops from ~2,570 → ~1,215 identity evals/sec per core. Latency variance also grew (stdev ~10 µs → ~220 µs).
Repro
from time import perf_counter
from flagsmith import Flagsmith
client = Flagsmith(
environment_key="<server-side-key>",
api_url="https://edge.api.flagsmith.com/api/v1/",
enable_local_evaluation=True,
environment_refresh_interval_seconds=3600,
)
client.update_environment()
# warmup
for _ in range(200):
client.get_identity_flags(identifier="anonymous", traits={"venue_id": "12345"})
for n in (100, 1_000, 10_000):
t0 = perf_counter()
for _ in range(n):
client.get_identity_flags(identifier="anonymous", traits={"venue_id": "12345"})
elapsed = perf_counter() - t0
print(f"{n:>6} iters: {elapsed*1000:8.1f} ms ({elapsed/n*1e6:7.2f} µs/call)")
Environment: flag-engine 10.0.1, Python 3.12, macOS.
- 主要语言
- Python
- 星标
- 24
- 派生
- 12
- 平均合并
- 15 小时 43 分钟
- 30 天内合并 PR
- 4
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Flagsmith/flagsmith-python-client 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 65/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 5/5 一周以上 新手友好度 45/100
查看 Flagsmith/flagsmith-python-client 的全部 Issue
相似的 Issue
-
bug ci good first issue
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
documentation
难度 2/5 半天 新手友好度 62/100
inmanta/inmanta-core#10835 ·
-
sponsored
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 86/100
Diaoul/subliminal#1382 ·