[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-dev
Subject:    Re: [xml-dev] Do long element names impact performance?
From:       Michael Kay <mike () saxonica ! com>
Date:       2015-10-15 14:53:36
Message-ID: 28994C63-7C5F-445C-9652-D4F05C8A51A0 () saxonica ! com
[Download RAW message or body]


> Comparing two strings for equality is linear time on the length of the
> strings.

Not necessarily. If most of the comparisons return false, it may be a lot better than \
linear. It's likely in many cases that the comparison will start by comparing the \
string lengths, so you might get the fastest comparison on average by having the \
lengths highly variable.

But who says it's string comparison that dominates? It might be the effect on network \
latency, or the cost of doing compression. You need to make measurements to find out.

Michael Kay
Saxonica
_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic