This PR removes the toBoolean() calls around $this->getOption() calls in validation rules. This improves the performance quite a bit by "only" losing on the functionality of having string "false" interpreted as false for boolean options in rules.
For ArticleType->createEntity() this is about 7% faster (1000 articles created). The TextRule apply is about 18% faster on short text and ~5% faster on a 20x longer text.
See https://github.com/honeybee/trellis/issues/14
This PR removes the
toBoolean()
calls around$this->getOption()
calls in validation rules. This improves the performance quite a bit by "only" losing on the functionality of having string"false"
interpreted asfalse
for boolean options in rules.For
ArticleType->createEntity()
this is about 7% faster (1000 articles created). TheTextRule
apply is about 18% faster on short text and ~5% faster on a 20x longer text.