[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [p2-dev] Serialized queries hard to read
- From: Thomas Hallgren <thomas@xxxxxxx>
- Date: Sat, 08 May 2010 08:25:24 +0200
- Delivered-to: email@example.com
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:18.104.22.168) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4
I agree that the XML encoded string that represents an expression is ugly.
On 05/07/2010 06:32 PM, Pascal Rapicault wrote:
While working on a solution to prevent RAP and the IDE to be installed together (306709), I met the serialized format of queries and I find that extremely unreadable (see example below). On top of that I'm also questioning the ability for this format to compress has good as before.
So my few questions are:
1) can we make this format more readable ?
We can write it out as a CDATA element, i.e.
<requirement min='0' max='0' greedy='false'>
<![CDATA[providedCapabilities.exists(x | x.name == $0&& x.namespace == $1&& x.version>= $2&& x.version< $3)]]>
<![CDATA[['org.eclipse.rap.rwt', 'org.eclipse.equinox.p2.iu', version('1.0.0'), version('2.0.0')]]]>
What does the old parser to when it encounters elements that it doesn't
recognize? I know that attributes are ignored. Does that also apply to
2) does this compress as good as before?
I can't see why not. It's all keywords, operators, and well known entities.
The QL parser is extremely fast so I don't think it's parsing will be
measurable. The XML parser is exposed to an attribute with a lot of
entities in it, but my guess is that it's very optimized to deal with
that. The only way to find out is to write performance tests. An easy
test would be to force the serializer to write everything in this format.
3) is parsing as fast as before?