Closed Bug 97176 Opened 23 years ago Closed 23 years ago

startup perf- remove the need of loading of fontEncoding.properties files at startup time to speed up

Categories

(Core :: Layout, defect)

x86
Windows 95
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.6

People

(Reporter: ftang, Assigned: ftang)

References

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

we currently load fontEncoding.properties at startup time, we should find a way 
to 
remove the need of loading it at startup time to speed up startup performance
we could 
1. build in common used pair in the cpp code, and/or
2. cache the resolved result in registry.
Blocks: 71781
per offline discussion with ftang - tentatively reassigning to myself
Assignee: ftang → jbetak
I refer to the code in gfx/src/windows/nsFontMetricsWin.cpp .Window specific 
code
Blocks: 103176
Keywords: perf
reassign to ftang
Assignee: jbetak → ftang
Target Milestone: --- → mozilla0.9.6
Status: NEW → ASSIGNED
Attached patch propose patch (obsolete) (deleted) β€” β€” Splinter Review
jbetak, can you r= this patch ?
r=jbetak 

the only part I didn't understand was why FreeGlobals() had to be removed. Also 
should we get rbs' sign-off on this? I believe this is his creation...
rbs- can you r= this one too ?
>the only part I didn't understand was why FreeGlobals() had to be removed. 
The code which load the property file used part of the InitGlobals(void) code.
And if we failed, we call FreeGlobal(). Now the code is move to be lazy loaded
into the system and in the mid of font enumeration. If we call FreeGlobal() in
the mid of it, I am not sure what will happen. We may release some code which
already reference to some existing object. So I think we should not FreeGlobal
if we failed. 




Looks OK. r=rbs with the following nits.

1) NS_ERROR_ABORT is intimidating and suggests gpf or something...
what about s/NS_ERROR_ABORT/NS_ERROR_NOT_AVAILABLE/g
(i.e., "special encoder is not yet available").

2)
+  return rv;
+}               <--- need blank line after this
+static nsresult
+InitGlobals(void)
+{

3)
And per local custom:
+  if(  -> "if (" everywhere

4)
Plus, no need for the return after else:
+  if(gFontEncodingProperties)
+    return gFontEncodingProperties->GetStringProperty(name, aValue);
+  else 
+    return NS_ERROR_ABORT;
s/return after else/else after return/
Looks good, but could I see a new patch that addresses rbs's comments? Thanks!
Attachment #52141 - Attachment is obsolete: true
Attached patch v2 of patch address rbs's review comment (deleted) β€” β€” Splinter Review
rbs, I address your comment in the v2 of the patch. can you r= it . waterson,
can you sr= it ?
Comment on attachment 52826 [details] [diff] [review]
v2 of patch address rbs's review comment

r=rbs
Attachment #52826 - Flags: review+
Blocks: 104056
Blocks: 104148
No longer blocks: 104056
Comment on attachment 52826 [details] [diff] [review]
v2 of patch address rbs's review comment

sr=waterson
Attachment #52826 - Flags: superreview+
Blocks: 104060
No longer blocks: 104148
fixed and check in 
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
No longer blocks: 104060
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: