Re: XML Parsing too slow



jabby wrote:
I have some files ranging from 6 meg to 15 meg that I need to process
to input into a database. I'm inheriting some old code using
XML::Simple and this process is taking forever (an hour or more). I
have eliminated the database as the time hog in this equation.

is there an alternative XML module I should be using?

Hi,

It really depends on the code, on why the process is slow and on the effort you want to put into re-writing it.

Why is the code slow? Is the call to XMLin, which loads the data into a Perl structure, slow? Or is the problem that the data takes up to much space in memory and that the system starts swapping pages? 6/15 Megs is not that much these days, so I am not sure the problem lies with XML::Simple. What are you doing with the data that takes that long?

You should probably start by running the XMLin call by itself to see how long it takes.

BTW XML::LibXML is indeed faster than XML::Parser-based modules like XML::Simple, but its interface is a lot different, instead of working with a Perl structure, you work with a DOM, so if most of the processing happens once the data has already been loaded in memory, I am not sure it will actually speed things up.

--
mirod
.



Relevant Pages

  • Re: dataset Performence Issue
    ... Microsoft that a DataSet is okay to abuse as a DataBase. ... Managed Code can never be as fast and as optimized ... very good for 90% of the situations i.e. normal memory usage, ... Merge/GetChanges - and oh lets not forget keeping your disconnected cache ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: To Normalize or not ??
    ... The problem is that when you run a split database, ... save a word document (it is in memory, and thus does not get saved). ... ms-access is different then excel or word. ... database server. ...
    (microsoft.public.access.formscoding)
  • Re: Can I Trust Pointer Arithmetic In Re-Allocated Memory?
    ... and leaving the database in an undefined state. ... memory and leave data it arrived unchanged. ... have already allocated with a null pointer. ... SOME people have to clean up in that fashion. ...
    (comp.lang.c)
  • Re: Memory leak in ASP.NET web site
    ... > I have a web app that makes many queries to the database on every page. ... > string to a method and I am passed a datareader or else individual values ... > There is a horrible memory leak in this application. ... > restored until SQL Server and IIS services are restarted. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Memory leak in ASP.NET web site
    ... > I have a web app that makes many queries to the database on every page. ... > string to a method and I am passed a datareader or else individual values ... > There is a horrible memory leak in this application. ... > restored until SQL Server and IIS services are restarted. ...
    (microsoft.public.dotnet.framework.adonet)