|
-
October 1st, 2003, 10:30 AM
#1
string concatenation & speed question
I have an app which generates somewhat lengthy HTML files (largest might be around 600K in normal use).
I emit the HTML tags in small pieces as the app calculates what the page should look like, then I write the tags to the file (a CFile object).
This naturally leads to a great deal of file writes, which are somewhat time consuming. If I do a profile, it shows that this is definitely an opportunity for improvement.
So, I though, simple enough: I'll just emit the HTML code to an internal string, and write the entire thing with one file write.
Well, using a CString as the buffer made things horribly worse. I suspect that CString concatanation is very slow.
Any suggestions? What would be faster than using a CString?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|