Closed Bug 368408 Opened 18 years ago Closed 17 years ago

Tiny SVG performance improvement

Categories

(Core :: SVG, defect)

1.8 Branch
x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: swsnyder, Unassigned)

Details

(Keywords: perf)

Attachments

(1 file)

Running SeaMonkey v1.1.0 on a 2.4GHz Pentium4-based Windows system the SVG performance is terrible, even with the MMX re-enabled in the build.  Profiling shows that about 40% of the execution time is spent in Microsoft's _lldiv() routine.

The problem is that 32-bit CPUs are just crushed by the repeated 64-bit fixed-point division used in _compute_x().  My significant improvements to this routine suffer from the occasional fatal division overflow, but I noticed this trivial improvement while doing them.

The signed long long division is so burdensome on 32-bit CPUs that just about any attempts to avoid them are cost-effective.
This patch avoids the 64-bit division in _compute_x() where possible.

In the benchmark http://www.hixie.ch/tests/adhoc/svg/perf/002-with-workarounds-for-asv3.svg the 64-bit division is avoided about 80,000 times, or 1% (yes, one percent) of the of the total calls to _compute_x().

For the Tab Preview feature of SeaMonkey _compute_x() is called for every preview but it seems that the division can be avoided 100% of the time.

Yes, a 1% improvment is pretty trivial, but I wanted to get this "on the record" given that SVG perforamnce needs all the help it can get.
Assignee: general → general
Component: General → SVG
Product: Mozilla Application Suite → Core
QA Contact: general → ian
(In reply to comment #1)
> Created an attachment (id=253013) [details]
> Reduces the frequency of 64-bit fixed-point division
> 

Have you reported this upstream in the cairo project http://cairographics.org/? It needs to get fixed there.
(In reply to comment #2)
> Have you reported this upstream in the cairo project http://cairographics.org/?

I have now.  I suspect, though, the the Cairo code present in the Gecko 1.8.1 code base is so old (v1.0.2, isn't it?) that it won't be relevant to the current (1.3.x) Cairo code.
Is this still relevant for Cairo 1.5.2, which is the current version on the trunk?
(In reply to comment #5)
> Is this still relevant for Cairo 1.5.2, which is the current version on the
> trunk?

The _compute_x() function, in which all that divsion was done, no longer exists in the trunk (24 Dec) copy of Cairo.

Displaying many tab preview images in SeaMonkey v2.0a1pre, I don't see _lldiv() consuming much CPU time.

So it seems that this is *not* relevant to trunk builds.
Given that this is no longer an issue on the trunk, and doesn't match the criteria for landing on the branch, this bug should be closed as INVALID or WORKSFORME, right?
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: