I received a pull request from a fellow BPBible developer for a great efficiency improvement (see http://github.com/jonmmorgan/wxwebconne ... bf1f4b5a91 for the change).
Basically, it seems that wxString::GetChar() is linear rather than constant time. Since this is used for every character in the string, the whole conversion is quadratic time. I assume this isn't too bad for converting comparatively small strings (like URLs) but it made our application really sluggish because we were using protocol handlers and thus every piece of HTML being displayed was being run through a quadratic algorithm.
I suggest it would be worth putting this fix into the next version of wxWebConnect.
Kirix Support Forums
wx2ns taking quadratic time
3 posts
• Page 1 of 1
- jonmmorgan
- Registered User
- Posts: 94
- Joined: Fri May 14, 2010 9:48 am
Re: wx2ns taking quadratic time
Hi there,
Thanks for point this out. You are right. We coded this for previous versions of wxWidgits, where this was not the case. However, now that we have this problem, I'll have to fix this little O(n^2) bug.
Ben
Thanks for point this out. You are right. We coded this for previous versions of wxWidgits, where this was not the case. However, now that we have this problem, I'll have to fix this little O(n^2) bug.
Ben
Ben Williams
Kirix Support Team
Kirix Support Team
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
Re: wx2ns taking quadratic time
Just to make sure (based on your comments) you do realise that there is a patch for this? [You are welcome to fix it by yourself if you want to, but if the changes are fine you can incorporate them as is].
- jonmmorgan
- Registered User
- Posts: 94
- Joined: Fri May 14, 2010 9:48 am
3 posts
· Page 1 of 1
Return to wxWebConnect Patches & Modifications