question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make validation optional

See original GitHub issue

I was trying to optimize some code of mine using the library (billions of DFA operations) so I ran a profiler and saw a lot of time was spent doing unions, specifically in PartitionRefinement.refine, cross product graph creation and then what surprised me was the __init__ function. And half of the time was due to validation. I think validation should be optional, so the user could pass in validate=False as a keyword argument when the user is a 100% sure that the construction is valid.

Thoughts on this?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
caleb531commented, Nov 3, 2022

@Tagl @eliotwrobson Great, thank you for the feedback. I already have a separate branch live for the global configuration, and will submit a PR for that within the next few days.

1reaction
Taglcommented, Nov 3, 2022

I agree, keep immutability. This could be noted in documentation for performance as a recommendation. A flag for validation is necessary in my opinion, as validation is one of the most demanding computation and is mainly a quality of life check when constructing the automata.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel validation rules - optional, but validated if present
I'm trying to make it validate ONLY if it's passed as not null, and nothing, not even 'sometimes' works :/ I'm trying to...
Read more >
how to validate optional fields - Laracasts
Hello everyone, I've some optional fields in my form. I want to know how to validate the optional fields only when the user...
Read more >
How to make a field optional using the validation rule in Laravel
In this shot, you will learn how to create optional and validated fields submitted from your form. This rule is one of the...
Read more >
Form validation when the field is optional - UX Stack Exchange
I'd go with option 2 (validate the field if it has been filled out). Option 1 (no validation) – users may provide an...
Read more >
Validate optional fields in Laravel - 5 Balloons
Validate optional fields in Laravel ... You can make use of nullable validation to only validate if user provided an value for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found