[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Serialized queries hard to read

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 elements?

2) does this compress as good as before?
I can't see why not. It's all keywords, operators, and well known entities.

	3) is parsing as fast as before?

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.

- thomas