dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] XmlTextReader performance problems and ResX


From: Rich Baumann
Subject: Re: [Pnet-developers] XmlTextReader performance problems and ResX
Date: Fri, 21 Jan 2005 17:30:29 -0500

On Thu, 2005-01-20 at 23:04 -0600, Marcus wrote:
> In another email, I reported that I was debugging ResXResourceReader. This 
> class reads .resx files, which are in XML format.  Items such as bitmaps can 
> be embedded in the .resx files, so they can be quite large. 
> ResXResourceReader uses the XmlTextReader class to read the file. After 
> fixing these bugs, I can actually read resource files with the class. 
> However, I discovered that my test app was getting bogged down in the 
> XmlTextReader.ReadElementString().
> 
> I wrote a standalone test that reads an XML file that contains an element 
> with 
> a large amount of text, similar to that in a .resx file. I experimented with 
> various sizes of the data and discovered that the time required to read the 
> element string was O(n^2). (For example, approx 1006 lines took 3 seconds, 
> 2000 took 11, 5000 took 63, and 10000 took 251.)
> 
> I cannot tell why the time required is increasing quadratically. The number 
> of 
> calls to the "hot" (frequently-called) methods only increases linearly (see 
> below).

Thanks for reporting this. I can't think of anything in the reader code
that would cause this and unfortunately I don't have the time right now
to investigate further. CALL_FOR_VOLUNTEER: If someone here is looking
to get involved in pnet work, here's a chance to get started. I suggest
putting traces of DateTime.Now before and after various parts of the
execution path to track down where the time increases non-linearly. Even
if you can't fix it, tracking down where the problem is would be very
helpful.


Rich



reply via email to

[Prev in Thread] Current Thread [Next in Thread]