Re: [go-nuts] what is the complexity of regexp.MustCompile()?

2020-06-11 Thread Ray Pereda
I think that regexp/syntax.patchlist.append refers to line 42 here https://golang.org/src/regexp/syntax/compile.go Using a singly linked list with a pointer to the tail pointer would give constant time append Ray On Thu, Jun 11, 2020 at 5:40 PM Andy Balholm wrote: > Right. That’s why I left th

Re: [go-nuts] what is the complexity of regexp.MustCompile()?

2020-06-11 Thread Ray Pereda
https://mycurvefit.com/ y = 7.763291 - 0.002980518*x + 0.08260165*x^2 with an R^2 value 0.9998 Ray On Thu, Jun 11, 2020 at 2:18 PM Andy Balholm wrote: > It’s more than linear. 1 repetitions take 73 times the time of 1000 > repetitions. > > Andy > > On Jun 11, 2020, at 2:1

Re: [go-nuts] what is the complexity of regexp.MustCompile()?

2020-06-11 Thread Ray Pereda
On my laptop, I compiled Andy's code from here: https://play.golang.org/p/82UBmyfyqV- I imported the output into google sheets and plotted it with a bar chart. https://docs.google.com/spreadsheets/d/1Pp8FBfHXgdMU54v6STutzDbb7SITGscFd84sUuJQ_gk/edit#gid=0 The runtime strongly looks linear. Still, t

[go-nuts] Re: what is the complexity of regexp.MustCompile()?

2020-06-03 Thread Ray Pereda
ssions also guaranteed linear runtime? I'm considering regular expressions with 1000s of keywords; very long regexps. I looked at the source and it was not obvious if that is the case. Intricate code. On Wednesday, June 3, 2020 at 10:07:12 AM UTC-7, Ray Pereda wrote: > > I believe that

[go-nuts] what is the complexity of regexp.MustCompile()?

2020-06-03 Thread Ray Pereda
I believe that the complexity of regexp.MustCompile() is linear based on this comment in the regexp package overview. "The regexp implementation provided by this package is guaranteed to run in time line

[go-nuts] filtering out machine generated Go library files

2020-01-22 Thread Ray Pereda
Is there a way to programmatically identify Go Standard Library source files that are machine-generated files? For example, consider this file: rewriteRISCV64.go That is