Skip to content

Conversation

@milk2715093695
Copy link

描述:

当前 PAC 文件在进行域名匹配时,采用线性遍历数组的方式,平均时间复杂度为 O(N)

本次提交使用 Set 替代数组查找,并引入基于域名长度的后缀分组哈希策略,将匹配复杂度优化为 O(1) + O(M),其中 M 为后缀长度的数量。

该优化保持原有逻辑与行为不变,预计在域名列表较大时能提升匹配性能。

这是我第一次尝试提交 PR,如有不规范之处,欢迎指正,非常感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant