[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-c-dev
Subject:    [jira] Created: (XERCESC-1857) unique/key constraint on non string
From:       "Leonid G (JIRA)" <xerces-c-dev () xml ! apache ! org>
Date:       2009-03-20 21:39:50
Message-ID: 202958380.1237585190776.JavaMail.jira () brutus
[Download RAW message or body]

unique/key constraint on non string field/attriibute slows validation 6x times vs \
                string attriibute
---------------------------------------------------------------------------------------------------


                 Key: XERCESC-1857
                 URL: https://issues.apache.org/jira/browse/XERCESC-1857
             Project: Xerces-C++
          Issue Type: Bug
          Components: Validating Parser (XML Schema)
    Affects Versions: 3.0.1
         Environment: Linux, Red Hat Enterprise Linux ES release 4 (Nahant Update 4), \
gcc 3.4.6, 32 bits.  Reporter: Leonid G


I have prepared a fairly small schema with 'xs:unique' constraint on nested element.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  <xs:element name="el1">
    <xs:element name="el2">
      <xs:element name="el3">
                        <xs:attribute name="key"                 type="xs:string" \
use="required"/> <!--                        <xs:attribute name="key"                 \
type="xs:unsignedInt" use="required"/>-->  </xs:element name>

        <xs:unique name="uniqCreativeKey">
              <xs:selector xpath="cam:creative"/>
              <xs:field    xpath="@key"/>
         </xs:unique>
    </xs:element name>
  </xs:element name>
</xs:schema>

I need to validate a relatively large xml (~ 100Kb) against this schema.

Load + validation take about 10s and process consumes ~100Mb of memory. I am using \
SAX, not DOM. If I change schema definition slightly to make type of "unique" \
attribute to be unsignedInt instead of string - than code runs ~ 1min:10 sec (7 times \
slower) and also uses about 100Mb of RAM.

Thus I have two questions:
1. Why parser requires 100Mb of RAM to load and validate 100Kb file 
2. Why changing attribute definition type from xs:string to xs:unsignedInt slows \
validation 7 times?

I have built xerces myself from sources.
./configure --disable-shared --enable-netaccessor-socket --enable-msgloader-inmemory \
--prefix=/mnt/builder/3rdParty/xml/xerces-c/3.0.1 \
--libdir=/mnt/builder/3rdParty/xml/xerces-c/3.0.1/lib.gcc-3.4.6


I can provide schema, xml and code that I am running.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic