I knew there was room for improvement in the auto-saving feature. So I've made some changes that make the process faster and more efficient.
As I talked about last time, the synchronous saving method just had to go. So I made it asynchronous for the 3 main text boxes: regular expressions, replacement string, and the target string. Now that it's asynchronous it doesn't slow you down as you type, even if the target string is quite long. Now, isolated storage does have a limit of 1 MB. So to make good use of space I've imposed a 200,000 character saving limit on these 3 text boxes. Anything beyond that will be truncated.
The other change is related to the way I auto-save the settings (checkboxes, expanders, etc). Before I was doing something which was a little bit stupid, as it turns out. I was saving these settings into an XML file in isolated storage. And to do so I had added the System.XML.Linq assembly into Silverlight. Well I found that this was unnecessary as isolated storage has a very nice IsolatedStorageSettings class that's perfect for storing the little stuff. Now that I've switched to this method, I've removed the Linq assembly. And that has brought the size of Regex Hero from 223 KB bytes down to 163 KB -- a 60 KB savings. So these changes make it faster, more responsive, and better in every way.
As I talked about last time, the synchronous saving method just had to go. So I made it asynchronous for the 3 main text boxes: regular expressions, replacement string, and the target string. Now that it's asynchronous it doesn't slow you down as you type, even if the target string is quite long. Now, isolated storage does have a limit of 1 MB. So to make good use of space I've imposed a 200,000 character saving limit on these 3 text boxes. Anything beyond that will be truncated.
The other change is related to the way I auto-save the settings (checkboxes, expanders, etc). Before I was doing something which was a little bit stupid, as it turns out. I was saving these settings into an XML file in isolated storage. And to do so I had added the System.XML.Linq assembly into Silverlight. Well I found that this was unnecessary as isolated storage has a very nice IsolatedStorageSettings class that's perfect for storing the little stuff. Now that I've switched to this method, I've removed the Linq assembly. And that has brought the size of Regex Hero from 223 KB bytes down to 163 KB -- a 60 KB savings. So these changes make it faster, more responsive, and better in every way.
Comments
Post a Comment