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
Here in the openapi 3 code it tries to cache a compiled regex in a sync map with a CompareAndSwap call, attempting to insert the new compiled regex in the map if the previous entry was nil.
Unfortunately this will never work as this call will only swap with an existing entry. If there is no existing entry for the key CompareAndSwap will not make a swap.
It is simple to fix the problem by replacing the CompareAndSwap call with a Store call. In my testing this halved the time take for validation of our schema, and reduced the allocations from 1133 per validation to 361.
I'm happy to provide a PR for this problem if desired.