Skip to content

Improved memory & cpu consumption

Latest
Compare
Choose a tag to compare
@korniltsev korniltsev released this 11 Aug 05:01
· 25 commits to main since this release
e11aad6

Improved memory & cpu consumption #22 (@zdyj3170101136 )

The API for parser changed. Now we parse one event at a time and if you need all the events, you need to copy it yourself.

chunks, err := parser.Parse(reader)
for _, chunk := range chunks {
    for chunk.Next() {
        chunk.Event // it may be reused, copy it if you need the event after another call to Next
    }
    err = chunk.Err()
    if err != nil {
        panic(err)
    }
}