Closed Bug 466578 Opened 16 years ago Closed 16 years ago

Speed up XBL parsing

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b3

People

(Reporter: taras.mozilla, Assigned: taras.mozilla)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 2 obsolete files)

This should shave off another 100-200ms off startup time. However, i can't conclusively show that startup is faster due it varying by +-250ms here.

To get the number I timed the runtime of individual functions loading xbl files and those show a conclusive speed up. Larger xml files parse 2x faster now with no measurable slowdown on smaller ones.
Attached patch reduce reads (obsolete) — Splinter Review
Assignee: nobody → tglek
Attached patch single read (fixed typo) (obsolete) — Splinter Review
Attachment #349879 - Attachment is obsolete: true
Just to give a bigger picture. Without my changes these files parse in about 610ms.
Attachment #349881 - Attachment description: single read9fixed typo) → single read (fixed typo)
Component: General → DOM
Product: Fennec → Core
QA Contact: general → general
Comment on attachment 349881 [details] [diff] [review]
single read (fixed typo)

my only concern here is the arbitrary maximum size
Attachment #349881 - Flags: review?(bzbarsky)
So this just helps because we thrash around less in networking-parser-networking?  Or something else?  That is, what made you make this change?

The change itself looks ok, with PR_UINT16_MAX used for the magic constant.

Are there other places where we could get similar wins?  I guess XUL is fastloaded, so not an issue there....
Actually IO and system calls in general on n810 are really slow. So this might be caused by that. Either that or each call into the parser is expensive, I'm not sure. I tried this from past experience indicating that parsing things in a big chunk is quicker than smaller incremental parses.
Perhaps we should consider increasing buffer sizes throughout necko from 4k to something bigger (16k?).  File followup bugs as needed?

Post a patch with PR_UINT16_MAX?
So I poked around some more. There is a superficially similar pattern in the CSSLoaderImpl::LoadSheet (according to oprofile callgraph) that's eating a few ms of start time. Fortunately css is less bloated than XML and increasing the buffers willy-nilly is either puny gain or a small performance loss.

So increasing buffers everywhere seems like it would hurt more unless those buffers will get used.
Attachment #349881 - Attachment is obsolete: true
Attachment #350032 - Flags: review?(bzbarsky)
Attachment #349881 - Flags: review?(bzbarsky)
Comment on attachment 350032 [details] [diff] [review]
single read(added constant)
[Checkin: Comment 11 & 12]

OK, let's do it.
Attachment #350032 - Flags: superreview+
Attachment #350032 - Flags: review?(bzbarsky)
Attachment #350032 - Flags: review+
Attachment #350032 - Flags: approval1.9.1?
Attachment #350032 - Flags: approval1.9.1? → approval1.9.1+
Comment on attachment 350032 [details] [diff] [review]
single read(added constant)
[Checkin: Comment 11 & 12]

a191=beltzner
Keywords: checkin-needed
Pushed fc47c2c3e3c1

I guess this is still checkin-needed for 1.9.1
Status: NEW → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Comment on attachment 350032 [details] [diff] [review]
single read(added constant)
[Checkin: Comment 11 & 12]

http://hg.mozilla.org/releases/mozilla-1.9.1/rev/bed2112e43b6
Attachment #350032 - Attachment description: single read(added constant) → single read(added constant) [Checkin: Comment 11 & 12]
Target Milestone: --- → mozilla1.9.1b3
Blocks: 459117
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: