Closed Bug 161825 Opened 23 years ago Closed 22 years ago

GetWidth optimizations need to be implemented on BeOS (text measurement performance)

Categories

(Core :: Layout, enhancement, P5)

All
BeOS
enhancement

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: roland.mainz, Assigned: attinasi)

References

Details

Attachments

(1 file, 2 obsolete files)

[follow-up of bug 36146 ("GetWidth optimizations need to be implemented on Unix (text measurement performance)")] RFE: GetWidth optimizations need to be implemented on BeOS (text measurement performance)
Depends on: 36146
Will look at problem. Though, a notice. Text rendering in BeOS port may be much faster if nsRendereningContext methods will be called with already UTF8 strings instead PRUnichar *.
Priority: -- → P5
Target Milestone: --- → Future
Seems stubs are too simplicistic or layout code ingores fact of missing GetTextDimensions - it causes very bad rendering of such pages as http://www.aftonbladet.se/vss/noje/story/0,2789,259021,00.html
advanced GetTextDimensions tends to produce weird results if 198890 isn't fixed
Depends on: 198890
No longer depends on: 36146
wondering if mAveCharWidth = width_of "x" is good approach for non-latin text
Attached patch Patch. First attempt. (obsolete) — Splinter Review
Ok, here is simple patch. Hope i didn't forget something. Paul, anyway, i'm unable to test it now (and next 10 day) with plain CVS sources. Hope you do. patch needs rebuild of mozilla/gfx, make clean/make in mozilla/layout/html/base/src and then make in mozilla/layout/build.
Adding rds (Roger B. Sidje) to CC as main authority
Comment on attachment 120709 [details] [diff] [review] Patch. First attempt. >+// Implementation is simplicistic in comparison with other platforms - we follow in this mehod Misspelled "method" (I know, nitpicking :-) >+ utf8buf = (uint8 *)mSurface->GetCharArray(); nsDrawingSurfaceBeOS does not define GetCharArray, or at least my version doesn't. Also, it seems your indenting with both tabs and spaces ;-)
Attached patch patch. 2nd take. (obsolete) — Splinter Review
Removed yet existent mSurface storage call, revised identation and spelling, added contributor name in nsRenderingContextbeOS.h
Attachment #120709 - Attachment is obsolete: true
(from attachment 120871 [details] [diff] [review]:) > NS_IMETHODIMP nsRenderingContextBeOS::GetHints(PRUint32 &aResult) { > aResult = 0; >+ aResult |= NS_RENDERING_HINT_FAST_MEASURE; > return NS_OK; > } I strongly suggest to add a env variable check or a prefs to turn this "on"/"off" on demand. In gfx/src/gtk/||gfx/src/xlib/ this helped much to hunt regressions/problems on the user's side without having the user to build mozilla first (or sending debug builds around) in the past and I assume this will help on BeOS as well...
2 Roland. Yeah, i probably will add it after Paul has current patch tested - if it applies and works at all. But i prefer in our case to add env variable dependency in way, where FAST_MEASURE is ON by default, and setting variable switches it off. As we haven't special testers, and hardly we can find sufficient number of enthousiast to set some suspicious variable to test some feature. And also BeOS is not Linux in some sense - there is no such desire (and need!)here to do something in CLI or edit text configs :))). So if someone report some weirdness, i will recommend her/him to set variable. But not vice versa.
Ok, I applied the updated patch. Did a full rebuild, and, it seems to work just fine. No problems here. And Sergei, I agree with your comment. Yes, we should have the option of turning this off, but, by default, I feel it should be turned on, as, like you said, most users will more than likely not turn it on themselves, and therefor, it would not get tested.
Paul, do you have some time to add this option, se we can check it in before tree is closed? I doubt that i can do it myself in next 2 or 3 days:(
Added a check for an environment variable. If set, changes will not be used. Need sr= for changes to layout code Also, this patch makes me wonder, are the any other optimization methods within mozilla that BeOS has be "#ifdef"'d out of?
Attachment #120871 - Attachment is obsolete: true
Comment on attachment 121015 [details] above patch, with ability to turn off changes sr=rbs, assuming you folks are happy with those details specific to BeOS.
Attachment #121015 - Flags: superreview+
Sergei, if you're ok with everything i'll check this in ASAPr=arougthopher
Attachment #121015 - Attachment is patch: false
Attachment #121015 - Flags: review+
Seems OK for me. I'm wondering if we can do some profiling/benchmarking with this option ON and OFF on some complex pages with lot of tables/text frames with justify alignment. On other platforms IIRC 5-20% preformance increase was reported.
Though I agree some profiling would be nice, I did see a noticable difference in rendering certain pages, when I added the env check, and having this turned ON or OFF. Marking fixed, as I have checked this in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: