Horde3D http://horde3d.org/forums/ |
|
XMLParser debugging sessions http://horde3d.org/forums/viewtopic.php?f=8&t=560 |
Page 1 of 1 |
Author: | DDd [ 18.11.2008, 21:18 ] |
Post subject: | XMLParser debugging sessions |
Hi, I was looking at the Converter code recently , doing a debug session, and i noticed that the XMLParser does a char compare on the tags to find the proper elements to copy. I noticed on a few occasions it compared two or more chars until it reached a diff char. Does anyone know if doing a len compare first is more expensive, than a char compare, because most of the tags don't have the same amount of chars, it would probably save a couple of compares, not exactly a huge issue, just wondering while i was debugging and decided to post about it. |
Author: | swiftcoder [ 18.11.2008, 21:37 ] |
Post subject: | Re: XMLParser debugging sessions |
It looks like those are C-strings (char *), which means NULL terminated, in which case a length comparison is O(n), because you have to iterate over the strings to find the NULL characters. |
Author: | DDd [ 18.11.2008, 21:40 ] |
Post subject: | Re: XMLParser debugging sessions |
ok, thanks for the info, there is no point in doing a len compare then |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |