From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7b97e385047500eb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!skynet.be!newspost001!tjb!not-for-mail Date: Sat, 04 Dec 2004 00:33:22 +0100 From: Adrien Plisson Reply-To: aplisson-news@stochastique.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: fr-be, fr, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Experiences of XML parser generators for Ada? References: <41af8365@news.wineasy.se> <2426353.SD16GYvm6f@linux1.krischik.com> <41b02dfe$0$25046$ba620e4c@news.skynet.be> <41b0cfc3$1@news.wineasy.se> In-Reply-To: <41b0cfc3$1@news.wineasy.se> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <41b0f749$0$25068$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 45bd2c77.news.skynet.be X-Trace: 1102116681 news.skynet.be 25068 217.136.134.43:17763 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news1.google.com comp.lang.ada:6747 Date: 2004-12-04T00:33:22+01:00 List-Id: Daniel W wrote: > Thank you for your succinct clarification. More specifically I'm asking for > persons with experience of the parser generator. I actually have XMLBooster > downloaded, but as I said, I'm sort of short on experience.... :-) well, i don't have any experience with parser generator (excepted with lex), but i would like to share my experience: i designed a software composed of 2 parts. all parts were written in a different language, and each part was executing in its own context (think of 2 different computers). i choosed XML as the format for marshaled data accross the communication medium. i first downloaded a standard XML parser (Xerces) and tried it. it was so slow that i could not continue with it. since i was only using a subset a XML (no dtd, no validation, no entity reference, only one encoding), i decided to write my own XML parser and XML generator. i got 70x performance boost. now if i look back, i think it would have been better if i had defined my own protocol and not used XML: - the xml fragment were all generated then parsed by software under my control, no user intervention. so there was no need for something human readable. - i was mostly transmitting numeric values. since xml is a text format, performances were teared down by all the conversions from binary to string and back to binary. - since i was mostly transmitting numeric values, all my text nodes were shorter than the xml element type enclosing those values. this leads to HUGE overhead. e.g.: 84 encoded in Unicode is 84 bytes long, but the value expressed here is only 1 byte long. - the only thing xml allowed me was extensibility at no cost, in a case were i was not really needing it. so here comes my advice: think twice before using xml. xml is a very powerful tool for DYNAMICALLY STRUCTURED HUMAN READABLE TEXT. for everything else, a basic binary protocol with some well defined rules to follow (endianness, size of data) will really be more efficient. plus, a basic binary protocol do not need complicated parsers... here was my experience, i hope you find it useful. -- rien