I'm not sure if I should remove the exception for content-length/actual body size? I googled around and found some examples where exceptions are thrown. I also experienced myself faced with an proplem of IIS, it was canceling processing of pages, if the content-length was not matching the actual size.
So generally I would keep the exception in...
Curr CI_Dict FindIndexMultiPattern
423 627 916
373 604 926
405 657 990
376 612 933
409 631 979
376 599 927
393,67 621,67 945,17
Interesting is, that the other used dict causes an factor of 1.5 in runtime. So it reduce some "ToUpperInvariant" calls, but makes the code slower.
The 3rd test uses the FindIndexMultiPattern method. Runtime grows to nearly one second.
For me it means that the original code is the fastest way and works properly. I'm surprised about the impact of the changes. So thanks a lot that you shared your ideas, it helps to improve MP2...
10T CI Dict OrdinalCI
379 642 387
384 600 349
371 629 348
407 600 381
388 630 359
411 593 378
390,00 615,67 367,00