W3C home > Mailing lists > Public > public-expath@w3.org > March 2013

Re: Draft of Binary module

From: Adam Retter <adam@exist-db.org>
Date: Thu, 14 Mar 2013 11:47:17 +0000
Message-ID: <CAJKLP9YwHGF2k9tvM+FmTzkXz5-SLpu-JArWe4pLa4uM3VCG=Q@mail.gmail.com>
To: Michael Kay <mike@saxonica.com>
Cc: Christian Grün <christian.gruen@gmail.com>, Florent Georges <fgeorges@fgeorges.org>, EXPath <public-expath@w3.org>
> implementor’s perspective, I believe it should usually be possible
> to find memory-saving optimizations for both variants; but it would be
> interesting to hear more about other implementations.
> Saxon implements xs:integer (and all its subtypes) using an object that
> wraps a java long if it fits in a long, or a java BigInteger if not. Sure,
> there are representations that would be smaller and faster, but I don't
> think that making savings on the way we handle integers has ever been on
> anyone's critical path.

I suppose its only on my critical path because we have users playing
with very large binary values from XQuery and I have seen what can go
wrong if you allocate just a few more bytes than you need for every
byte in the source file.

> Of course, for the integer sequence that results from binary-to-octets, we
> would not materialize the integers eagerly.
> In Saxon-CE we use java BigDecimal throughout. Makes everything much
> simpler.
> Michael Kay
> Saxonica

Adam Retter

eXist Developer
{ United Kingdom }
Received on Thursday, 14 March 2013 11:47:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:52:20 UTC