Projects
Wiki     Timeline     Roadmap     Browse Source     View Tickets     New Ticket     Search

Ticket #16 (assigned Enhancement)

Opened 4 years ago

Last modified 9 months ago

Use incremental XML parsing to avoid blocking

Reported by: wsanchez@… Owned by: wsanchez@…
Priority: 2: Expected Milestone: CalendarServer-3.x
Component: Calendar Server Severity: Performance
Keywords: Cc:

Description

When we receive requests from the network which contain XML bodies (eg. DAV methods), we read the request stream into memory until we have all of it, then parse the XML. This is the only option we ahve with PyXML, I think, since it's parse() routines require a string, or do blocking I/O on a filehandle.

The downside here is that we have to have all of the XML in memory before we can continue, which is lame.

What we actually want is a parser that we can feed data to incrementally. ElementTree appears to have this property, so switching parsers to ElementTree could be nice. ElementTree also has the advantage of being slated for inclusion in future python releases, seems lighter weight than PyXML, and has a less complicated licensing situation.

We should also consider LXML, which is ElementTree-like, but binds to the Libxml2 C library and apparently performs better.

What we're after here is better performance, in terms of both memory and CPU. XML parsing and iCalendar parsing are, I think, going to be some of our prominent bottlenecks.

I'll mark this as a P4 for Preview 1, since our main goal for Preview 1 is feature completeness, so people can start using it.

Change History

Changed 4 years ago by wsanchez@…

Note that this is actually an issue for twisted.web2.dav; so we need to mirror the bug in Twisted's trac and fix it there.

Changed 4 years ago by wsanchez@…

  • type changed from Defect to Enhancement

Changed 4 years ago by wsanchez@…

  • priority changed from 4: Nice to have to 2: Expected
  • status changed from new to assigned
  • summary changed from Use incremental XML parsing to Use incremental XML parsing to avoid blocking

See #40

Changed 4 years ago by wsanchez@…

  • milestone changed from Preview 1 to Version One

Changed 3 years ago by wsanchez@…

  • milestone changed from 1.0 to 2.0

Changed 9 months ago by wsanchez@…

  • milestone changed from CalendarServer-2.x to CalendarServer-3.x
Note: See TracTickets for help on using tickets.