Hello, I am currently trying to tackle a speed issue involving loading and saving richtext. Here are the details. In my application I have a Question class which needs to be able to store two richtexts. At the moment these two richtexts are being stored in the Question class as TextRanges. As far as saving/loading goes I am using TextRange.Load(Stream, DataFormats) and TextRange.Save(Stream, DataFormats). Everything works...
My problem is that I need to have 1000+ of these questions save/load from a file. When I do this saving/loading a file that contains these questions takes 20~ seconds. And on top of that, I would like to be able to load several of these files at once...which would leave the user waiting for possibly several minutes. I'm sure my problem is clear now.
So I started to investigate why it was taking so long to save/load a file and from a profiler I found that 80% of the time spent saving/loading a file is in the TextRange.Load and TextRange.Save methods.
So my question is...Does anyone have any suggestions or pointers to speeding up my file save/load?
I was trying to think of another way to store the richtext in both the Question class and in the file. I ran out of ideas fairly quickly but wanted to come here before I conceded. Any help is greatly appreciated. Also let me know if I need to clarify anything. Thank you!