Closed Bug 364785 Opened 18 years ago Closed 18 years ago

ts regression by bug 362665 and bug 364678

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: perf, regression)

Attachments

(3 files, 2 obsolete files)

Now, we have a ts regression, the cause is bug 362665.

The patch of bug 362665 creates "perfect" font list at starting up.
If we delay the some part of the process, we may fix this regression.
OS: Windows XP → Mac OS X 10.4
Note that I will attach a proposal patch, but how to test it?

And I don't want to back out the current patch. Because pre bug 362665 builds are not usable build for CJK users. (see bug 357555) The perf regression is not a critical, but bug 357555 is critical for CJK testers.
Bug 364678 checked-in creates more regression.
Blocks: 364678
Status: NEW → ASSIGNED
Summary: ts regression by bug 362665 → ts regression by bug 362665 and bug 364678
Attached patch Patch rv1.0 (deleted) — Splinter Review
This patch is a minimum patch, and I don't know whether it's fast how.

1. FontEntry doesn't initialize at creating, it will be initialized at first using.
2. |ATSUGetIndFontName| is called only once per a font name.(current trunk calls it twice per a font name.)
3. The text converter is not created every time. If the encoding is changed, the converter will be recreated.

I have another idea, but I need more time for the another patch.(And I don't know whether the another approach will work fine.)
Attachment #249506 - Flags: review?(vladimir)
Ts testing on my environment.

current build:
2733, 2144, 2126, 2538, 2229, 2261, 2378, 2124, 2694, 2149

patched build
2593, 2176, 2457, 2132, 2139, 2159, 2046, 2074, 2124, 2146

AVG 2337.6 vs 2204.6
But the values of current build are shaken. I don't know whether we can trust this test.
Thank you vald. I checked-in the patch.
MacOSX Darwin 8.8.4 bm-xserve08 Dep
984 -> 951 -> 953

MacOSX Darwin 8.7.2 xserve06 Dep Universal Nightly
1918 -> 1840 -> 1833
Attached patch Patch #2 rv1.0 (obsolete) (deleted) — Splinter Review
This is a final patch. I don't have more idea for improve the performance.

This patch only caches the mac font names. Other names will be cached in ResolveFontName at first using. I want to cache the one name only per font. But the mac font name cannot be found by ATSUFindFontFromName with Unicode name. I think that if we want to find by the API, we need to convert the given name to correct encoding. But we cannot know the encoding from given name. Therefore, I cannot create the "best" patch...

But this patch gets the postscript name at first, by this, the redundant loops can be removed from the end of the for loop for |fontIDs|.

And I remove the nsAutoString variables from for loops.

And this patch also fixes bug 364832.
Attachment #249574 - Flags: review?(vladimir)
Attached patch Patch #2 rv1.1 (obsolete) (deleted) — Splinter Review
Removing the redundant code.
Attachment #249574 - Attachment is obsolete: true
Attachment #249787 - Flags: review?(vladimir)
Attachment #249574 - Flags: review?(vladimir)
Comment on attachment 249787 [details] [diff] [review]
Patch #2 rv1.1

This patch has a bug.
Attachment #249787 - Flags: review?(vladimir) → review-
Attached patch Patch #2 rv2.0 (deleted) — Splinter Review
We need one more step. Because [NSFont fontName] sometimes returns a known font that cannot be listed up by ATSUI. We should resolve the basic family name to postscript name at first using.
Attachment #249787 - Attachment is obsolete: true
Attachment #249835 - Flags: review?(vladimir)
(In reply to comment #11)
> We need one more step. Because [NSFont fontName] sometimes returns a known font

-> Because [NSFont fontName] sometimes returns an *unknown* font

sorry.
checked-in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
I forgot a comment.

I think that this patch will be faster than current trunk build. But it is slower than pre bug 362665. Because there are necessary code -so, we cannot remove it- in starting up code. If you can write faster code, please file a new bug. This patch has a best performance I can think now.
Umm... The patch is not faster than the previous build (but not slower) in tinderbox :-(

Irrespective of the amount the listed up font names is decreased...

This bug only wins by patch rv1.0 (see comment 6).
# The patch #2 rv2.0 fixes other bug too, we don't need to back out it.
Depends on: 374251
Changeset d292ca6cf27b in mozilla-central referenced this bug here. The bug # in the check-in comment was wrong, correct bug # is Bug 480698.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: