Alanxtl commented on issue #699:
URL: https://github.com/apache/dubbo-go-pixiu/issues/699#issuecomment-3485120674

   > > > 那我掏出超长正则匹配,阁下如何应对
   > > 
   > > 
   > > Hi [@zeusro](https://github.com/zeusro) 
和正则表达式的复杂程度没关系啊,我们缓存的是正则表达式编译之后的数据,为的是减少正则表达式编译过程的耗时
   > 
   > 与C#的正则表达式超时相比,目前golang应该没有正则的超时匹配概念。
   > 
   > public Regex (string pattern, System.Text.RegularExpressions.RegexOptions 
options, TimeSpan matchTimeout);
   > 
https://learn.microsoft.com/zh-tw/dotnet/api/system.text.regularexpressions.regex.-ctor?view=net-9.0#system-text-regularexpressions-regex-ctor(system-string-system-text-regularexpressions-regexoptions-system-timespan)
   
   感谢补充,不过我们这里缓存的是正则编译结果,目的仅是避免在路由构建阶段重复调用 regexp.Compile,与正则匹配阶段的性能或超时无关。
   Go 使用的 RE2 引擎本身不会出现灾难性回溯,因此缓存行为不影响匹配安全性,也不会引入正则超时相关的问题 :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to