Performance problem in C#

Hans-Peter Bittner 116 Reputation points
2021-12-23T22:10:37.173+00:00

I have a code-module in C#, which contains a loop with math. operations. At the end of each execution of the loop I get the UTC-time in milliseconds and store this by writeline() in a protocol-file (for example 200 lines at all). When the code-module is part of a small project, the loop runs quickly and with nearly constant speed. But when the identical code-module with the same input data is part of a bigger project, the loop runs at the beginning approx. 1.5 - 3 times slower and then the speed goes lower and lower. How is this possible? I have found no error in my code.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,363 questions
{count} votes

8 answers

Sort by: Most helpful
  1. Hans-Peter Bittner 116 Reputation points
    2021-12-24T19:47:01.59+00:00

    While executing my script-file including "Math_FourierTransform(Matrix1, out Matrix2, Vorwärts); " and "Math_FourierTransform(Matrix2, out Matrix3, Vorwärts);" by my interpreter in the debugger, no exception is released, but the speed slowing continues.

    0 comments No comments

  2. Hans-Peter Bittner 116 Reputation points
    2021-12-25T17:42:44.593+00:00

    Message from the code-analyse-tool: "No code analyse problems found", but the speed slowing continues.

    0 comments No comments

  3. Hans-Peter Bittner 116 Reputation points
    2021-12-26T16:30:55.437+00:00

    In the task manager I have seen, the RAM usage by the task "vshost.exe" grows from 118 MB up to 622 MB while executing Math_FourierTransform() in my bigger project with certain parameters and slowing speed. This indicates me where I have to search further more. Probably Dispose() can help. Thanks!

    0 comments No comments