Timeline for Checking if an object meets certain criteria to amend to certain Entity Objects?
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 12, 2019 at 12:16 | vote | accept | KyloRen | ||
Jul 11, 2019 at 0:29 | comment | added | KyloRen | Doing that instead of Regex brings 1500 line file with 200 properties down to 20ms from 30ms. One third faster is on just that is awesome. Overall I think I have reduced run time to half its original time it took. Thanks for the help.There are a couple more things I think I can do, but this has got me on the right track. | |
Jul 10, 2019 at 23:38 | comment | added | Pieter Witvoet |
Another optimization is to create and reuse a single (compiled) Regex instance instead of calling the static IsMatch method, so the regex engine doesn't have to parse the pattern each time. Or, for such a simple pattern, string.Any(char.IsDigit) (for \d ) or string.Any(c => c >= '0' && c <= '9') (for 0-9 ) is even faster.
|
|
Jul 10, 2019 at 23:22 | comment | added | KyloRen |
+1. And you absolutely correct. As I was re-writing the question, saw I was doing a fair bit of redundant code. As you say, validate the GovernmentCsvReord class and then convert to the needed entities. Thanks for the advice on the Regex, I am not very good with it, so that helps enormously as well.
|
|
Jul 10, 2019 at 15:36 | history | answered | Pieter Witvoet | CC BY-SA 4.0 |