moov-io / rtp20022

ISO20022 messages in Go for Real Time Payments (RTP)
Apache License 2.0
40 stars 9 forks source link

avoid recompile regex by caching #45

Closed jerome-laforge closed 8 months ago

jerome-laforge commented 8 months ago

Hello, Is it possible to avoid to recompile regex each time you want to validate the message? We can use cache protected by mutex like openapi https://github.com/go-openapi/validate/blob/194d97ec43681857f9279b7c36eed18c8c70e7a1/rexp.go#L26C54-L26C54

Thx in adv Best

adamdecaf commented 8 months ago

Good call, added in https://github.com/moov-io/rtp20022/pull/46