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.

Large validation performance

See original GitHub issue

Validating a very large set of items is slow.

TestValidator<TestItem> val = new TestValidator<TestItem>();
            val.RuleFor(x => x.Value1).NotEmpty();
            val.RuleFor(x => x.Value2).NotEmpty();
            val.RuleFor(x => x.Value3).NotEmpty();
            val.RuleFor(x => x.Value4).NotEmpty();
            val.RuleFor(x => x.Value5).NotEmpty();
            val.RuleFor(x => x.Value6).NotEmpty();
            val.RuleFor(x => x.Value7).NotEmpty();
            val.RuleFor(x => x.Value8).NotEmpty();
            val.RuleFor(x => x.Value9).NotEmpty();
            val.RuleFor(x => x.Value10).NotEmpty();

            Fixture fix = new Fixture();
            List<TestItem> items = new List<TestItem>();

            for(int i=0;i<100000;i++)
            {
                items.Add(fix.Create<TestItem>());
            }

            Stopwatch sw = new Stopwatch();
            sw.Start();

            for (int i = 0; i < items.Count; i++)
            {
                val.Validate(items[i]);
            }

            sw.Stop();
            Debug.WriteLine(sw.Elapsed.TotalMilliseconds);

Validate all items take 90 seconds…

There is any tips to optimize performance ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
mdisselcommented, Jul 4, 2017

3 seconds still seems slow for such a simple validation

0reactions
joffreynorsyscommented, May 30, 2017

Yes. I test the case with a simple console app and there is the same result. In debug mode 90 seconds in release mode 3 seconds. I continue to investigate…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Large Mismatch between Validation and Test Set Performance
The problem is that there is a poor correlation between validation performance and test-set performance. For example, Model A has a 56% ...
Read more >
Large variation in cross-validation scores [closed]
1 Answer 1 · the data is not randomized, which could explain why the first fold get a very different performance than the...
Read more >
What does a large difference between validation and test ...
I'm training and testing a model and noticed that there's a large gap between validation and test set performance (around 6-7%).
Read more >
Higher validation accuracy, than training accurracy using ...
Fact is validation loss and accuracy do not have real meaning until your training accuracy gets reasonably high say 85%. Share.
Read more >
Training and Validation Loss in Deep Learning
Now, to assess the performance of a model, we use a measure known as loss. Specifically, this loss quantifies the error produced by...
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