🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.xml
Article #117

Re: TXMLDocument is memory hog, need alternatives

#117
From: Stefan M. Huber
Date: Sun, 27 Jan 2008 09:28
55 lines
2262 bytes
On Sun, 27 Jan 2008 03:06:51 +0100, Brian Thomas  
<brian.thomas@doorgroup.com> wrote:

> I am using Delphi 7.0. In the past I have written a generic  
> import/export routine using TXMLDocument and it has worked wonderfully  
> but with my last export to a file (my data is quite large) I found two  
> problems: 1) TXMLDocument is extremely slow, and 2) it is all memory  
> bound. So much so that my app ran up to 1.6 Gig of memory and ran out of  
> memory and died.
>
> Thus, I need an alternative. Someone at our company wrote a similar  
> routine using the FileStream classes and it is fast enough but he's  
> manually concatenating '<' and '>' to our elements. I would like  
> something fast but want something more structured so the code will  
> handle the elements/attributes like TXMLDocument does. Besides that, I  
> would like to be able to read the xml document without having to search  
> for '<' and '>' characters. Any ideas?

Splitting of your data: Create on file for one instance of whatever data  
you have and read them. You could even create the semantic context of all  
those files by having something like

<data>
   <item/>
   <item/>
</data>
<continues in="next_file_name.xml">

You will know best how to spilt up your data to decrease file sizes and  
thus memory usage

Stefan
Technical Details
Message-ID: <op.t5k0lfuds9ddfw@mars.huste.lnet>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <479be6fa$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f5d9b,e200cd528b61b17c
X-Google-Attributes: gidf5d9b,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sun, 27 Jan 2008 10:28:17 +0100
Subject: Re: TXMLDocument is memory hog, need alternatives
From: "Stefan M. Huber" <looseleaf@gmx.net>
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Newsgroups: borland.public.delphi.xml
References: <479be6fa$1@newsgroups.borland.com>
Content-Transfer-Encoding: Quoted-Printable
Message-ID: <op.t5k0lfuds9ddfw@mars.huste.lnet>
User-Agent: Opera Mail/9.50 (Win32)
NNTP-Posting-Host: 85.127.83.3
X-Trace: newsgroups.borland.com 1201426097 85.127.83.3 (27 Jan 2008 01:28:17 -0700)
Lines: 55
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail