Closed Bug 1377515 Opened 3 years ago Closed 2 years ago

IsCJKFont shows up in gmail profile

Categories

(Core :: Graphics: Text, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: neerja, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

This gmail profile has a sample showing IsCJKFont. Spoke to jfkthame and he thinks it could be optimized. 

Profile:
https://perf-html.io/public/760909d9456fb753500182eb04f593317b948d48/calltree/?invertCallstack&search=isCJKFont&thread=5
Whiteboard: [gfx-noted]
I doubt the difference is really measurable, but in principle this should be better as it tries to just access the table without copying.
Attachment #8908976 - Flags: review?(bas)
Comment on attachment 8908976 [details] [diff] [review]
Use GetFontTable rather than CopyFontTable in gfxDWriteFontEntry::IsCJKFont() to try and avoid copying

Review of attachment 8908976 [details] [diff] [review]:
-----------------------------------------------------------------

Seems like strictly an improvement to me.

::: gfx/thebes/gfxDWriteFontList.cpp
@@ +698,5 @@
>  
>      mIsCJK = false;
>  
>      const uint32_t kOS2Tag = TRUETYPE_TAG('O','S','/','2');
> +    hb_blob_t* blob = GetFontTable(kOS2Tag);

nit: Maybe add a comment that if anyone adds any early return paths here they need to remember to call hb_blob_destroy? It's a shame we don't have an RAII class for this.
Attachment #8908976 - Flags: review?(bas) → review+
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/98c159aec57e
Use GetFontTable rather than CopyFontTable in gfxDWriteFontEntry::IsCJKFont() to try and avoid copying. r=bas
https://hg.mozilla.org/mozilla-central/rev/98c159aec57e
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Assignee: nobody → jfkthame
You need to log in before you can comment on or make changes to this bug.