io.Reader as an input instead of raw byte slice. I use regex to parse bytes from file (2-10mb), can I improve this using io.Reader?
Can someone give me a reference for this?
The speed and cpu usage. Parsing large byte using regex, pattern per pattern are expensive.
well... there's only one way to find out - profile & benchmark
why even use regex then?
What was the norm? Byte by byte matching? I'm trying to write by that method but it's nauseating just to think about. The pattern is simple though.
what regex do you have? maybe you can divide the read into chunks and then use your regex on those chunks with goroutines
Обсуждают сегодня