WPF Dictionary Binding failure is very slow

前端 未结 3 966
感情败类
感情败类 2021-01-07 02:39

I have most of the Label objects in my app bound such that they can be replaced from a webservice.

I store my replacements in a Dictionary. The repla

3条回答
  •  再見小時候
    2021-01-07 03:14

    Yes, the speed can be improved dramatically if you do not run the code in a debugger. Actually the printing of the stackteace in Visual Studio is by far the slowest part. If you run your application without a debugger attached, I am pretty sure the performance loss will not be noticable anymore.

    I had a similar problem where we were catching an exception inside a library and even if you do that VS will print a note about a first chance exception being caught in code, every time the exception is being caught (and handled). The exception was triggered about 50 times at the startup and it took the application like 10 seconds to startup and all just because of the console logging. Once I ran the application without a debugger it started up almost instantly.

    So maybe trying to workaround that exception is just premature optimization.

提交回复
热议问题