jschaedl / iban-validation

:bank: A small library for validating International Bank Account Numbers (IBANs)
MIT License
88 stars 19 forks source link

YAML registry parsing is quite slow #61

Closed stephanvdhorn closed 2 years ago

stephanvdhorn commented 2 years ago

As requested by: https://github.com/genkgo/camt/pull/110#pullrequestreview-813685962

The registry loader is quite slow because it has to parse ~1200 lines of YAML before it does any validation.

So for the use case in the CAMT package, it has to create a new validator for each IBAN it encounters. (our testing file has about 700 IBAN numbers and that takes quite awhile)

My suggestion would be to use arrays instead of YAML, so it doesn't have to parse anything. What do you guys think?

jschaedl commented 2 years ago

Hi @stephanvdhorn, sounds like a good idea to me. Are you up for a pull request?

PowerKiKi commented 2 years ago

Using native array sounds like a good idea to me, and it should allow us to drop the dependency on symfony/yaml