[ 
https://issues.apache.org/jira/browse/XERCESC-1821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615543#action_12615543
 ] 

Alberto Massari commented on XERCESC-1821:
------------------------------------------

George,
I think the current code is a good compromise for a generic XML parser: it 
starts with a decent pool that doesn't waste too much space, and grows 
dynamically up to 512Kb in a rapid way. Moreover, if the user know he is 
loading a big document and wants to reduce the number of pool items, he can 
tune the parameter per document. Allowing the user to change the initial value 
globally would introduce 
a) synchronization problems 
b) a performance penalty if we have to guard the variable with a mutex 
c) defeat compiler optimizations if the variable is no more a const 

But in any case, if you really think that your project must use a different 
approach, you are free to change the code and recompile Xerces in the way it 
suits you.

Alberto

> Configurable  kInitialHeapAllocSize in xerces
> ---------------------------------------------
>
>                 Key: XERCESC-1821
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1821
>             Project: Xerces-C++
>          Issue Type: Improvement
>          Components: DOM
>         Environment: All OS
>            Reporter: george
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> The default  DOM initial heap size is 16k in the latest release (earlier 
> release was 64k).  this number could be still too big or too small for some 
> system.
> The idea is to make the following parameters configurable in the constructor 
> via a singleton read function.
> static XMLSize_t kInitialHeapAllocSize =  0x4000;
> static XMLSize_t kMaxHeapAllocSize     =  0x20000;
> static XMLSize_t kMaxSubAllocationSize =  0x1000;  // Any request for more 
> bytes
> Now the question is if you think this is a valuable suggestion?   I have a 
> working code and would like to share if you think it worth the effort.
> Cheers
> George

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to