I'm making an app that converts images into textual RRR GGG BBB string arrays.
It works very fast with small images, but when the pixel count of input image is very high, the app slows down progressively.
The application runs x,y loop through all the pixels of input image, scans each pixel and adds its RGB formatted values to the final string which will be saved as text after the whole image is scanned.
With help of built-in profiler I found out that the System.String.Concat(string,string) takes more and more time the bigger the final string gets.
I then tried making a temporary string that will save the result of calculations of 1 row and before entering the next row, add it to the final string. Now it works about ten times faster, but still closer to the end, performance drops.
But in the end all my test images are smaller than the real ones are going to be. How do I keep concatenation speed high with even bigger images?