You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go1.6 darwin/amd64
What operating system and processor architecture are you using (go env)?
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
I found Go regex is too slow. I compared the regex perf between java and Go:
Go code:
text := "$value1$;$value2$;$value3$"
for i := 0; i < 1000000; i++ {
match := pattern.FindAllStringSubmatch(text, -1)
for _, _ = range match {
}
}
Java code:
String value = "$value1$;$value2$;$value3$";
for (int i = 0; i < 1000000; i++) {
Matcher matcher = pattern.matcher(value);
while (matcher.find()) {
// do nothing
}
}
Go costs 2.702s and Java costs 472ms.
What did you expect to see?
I think Go regex should not slower than Java so much.
What did you see instead?
Go regex is much slower than Java.
The text was updated successfully, but these errors were encountered:
Go regex is known to be slower than Java (such as [1]). Is there a recent case you are reporting where you have seen a major perf downgrade or are you talking about the general case where Go is known to be slower?
I don't know the current involvement but making the regex more performant is a long-shot goal, not sure we can keep track of it under an issue on the tracker.
Please answer these questions before submitting your issue. Thanks!
go version
)?go1.6 darwin/amd64
go env
)?GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
I found Go regex is too slow. I compared the regex perf between java and Go:
Go code:
Java code:
Go costs 2.702s and Java costs 472ms.
I think Go regex should not slower than Java so much.
Go regex is much slower than Java.
The text was updated successfully, but these errors were encountered: