Boost logo

Boost :

From: Dan Nuffer (dnuffer_at_[hidden])
Date: 2002-01-17 11:54:24


Vladimir Prus wrote:
> Dan Nuffer wrote:
>
>>rogeeff wrote:
>>
>>>Hi,
>>>
>>>First of all I would like to say that IMO it is odd even to discuss
>>>an ability to use Spirit for generic command line parser. It's like
>>>use a canon to kill a fly. For one It is very expensive and heavy and
>>>also I should drag it all over the place.
>>>
>>That statement is completely false.
>>Please don't spread FUD about something with which you are not familiar.
>>
>
> I think you'll agree that concerns about code size, speed, and dependency on
> other libraries are in general reasonable. It would help a lot, if instead of
> one person expressing such concerns and another person stating that there's
> no need to worry, you'll provide us with a table of grammars and code sizes
> on various compilers.
>

Well, rogeeff didn't express concern, he said something false as if it
were fact.

>
> Again, I'd like to see numbers.
>

Okay. I'm not going to go to the work of creating 2 identical parsers
and comparing them, but here's an general comparison that you can take
for what it's worth.

I'm using gcc 3.0.3 with -O3 flag to compile.

We have an example called simplexml.cpp which parses XML, but does no
DTD validation. It's 212 lines long: 110 of that is to define the XML
parser, and the rest is simple xml test snippets. When compiled and
stripped, the executable is 102604 bytes.

Now, take libxml 2.4.5. It's an XML parser written in C. The actual
XML parser is in a file called parser.c, which is 10199 lines long!
When compiled, the object file is 115516 bytes.

Now, this comparison is not exactly fair, since libxml does more work in
parser.c than simplexml.cpp does, but you can see in general how Spirit
compares against a hand-coded C solution.

--Dan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk