I will give it a try.
-----Original Message----- From: Sebastian Geerken [mailto:s.geerken@ping.de] Sent: Tuesday, October 14, 2003 1:55 PM To: Dillo mailing list Subject: Re: [Dillo-dev] FLTK
Hi!
To have some facts for this discussion, there is a (basicly working) patch for the Gtk2 port, at <http://www.dillo.org/misc_files/gtk2.diff.gz>. It is a slightly modified version of a patch, which Jörgen sent me some time ago, and compiles with the current CVS (probably not with 0.7.3).
Sebastian
_______________________________________________ Dillo-dev mailing list Dillo-dev@lists.auriga.wearlab.de http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
-- En reponse de "RE: [Dillo-dev] FLTK" de Eric Gaudet, le 14-Oct-2003 :
I will give it a try.
Hi!
To have some facts for this discussion, there is a (basicly working) patch for the Gtk2 port, at http://www.dillo.org/misc_files/gtk2.diff.gz It is a slightly modified version of a patch, which J�rgen sent me some time ago, and compiles with the current CVS (probably not with 0.7.3).
Sebastian
Ok, here are the numbers. But first, the test procedure. I did a fresh cvs checkout twice, and applied the patch to one of them and compiled both. I named dillo1 the one using gtk-1.2 and dillo the one using gtk-2.0. The only difference between dillo1 and dillo2 is the gtk version they use, everything else is the same (internal representation of the page widgets) I'm running debian testing and I updated my system just before the test today: gtk 2.2.1-6 and pango 1.2.5-1. My machine is a Toshiba 3020CT laptop, Pentium-MMX 300MHz with 64MB ram First run: ---------- I tried to render the front page of tigerdirect.com, which should represent a fairly common page design. First, I download the page and the images with 'wget -kp http://www.tigerdirect.com'. index.html is 66kB and it loads 30 gif and 23 jpg images. I loaded the page with both dillo1 and dillo2 with the command 'time dillo1 index.html'. I exited dillo shortly after the loading and rendering were completed. The idle time after rendering is not included in the results, nor is the system time used to actually load the page: I'm only giving the user time, which is the cpu time the application used. I'm also not giving the real time for this run, since it depend on the average cpu load, the memory swapping, etc, and would need a much more elaborate benchmark to be significant. For the memory usage, I used pmap on the dillo process, and added only the anonymous pages (mallocs). For each browser, I ran the test once, disregarding the time (to let buffering occur), then several times and calculated the average time. Results: time1 time2 delta/30 prps mem(KB) dillo1 1.36s 1.82s 15ms 67 2516 dillo2 3.10s 6.90s 126ms 8 3624 Legend: - time1 represent the time for starting the browser, wait for rendering to complete, and quit. - time2 represents the time for starting the browser, wait for rendering to complete, then press the pagedown key twice, then the pageup key twice, for a total of 30 redraws of the page, them quit - delta/30 is the difference between time2 and time1 divided by 30. This is the time to redraw the page. - rps is the number of page renderings per second: this is 1/(delta/30) - mem is the memory usage in KiloBytes. Conclusion: The starting time is longer for dillo2, but not too by much and I think I could live with it. Scrolling through the page is noticeably slower, with a significant delay between the clicks or key presses and the actual redraw. dillo1 is always snappy and blazing fast, even when dragging the page with the middle button. dillo2 feels heavy and slow, and it's hard to drag the page around, since the page display is following the mouse movements with a delay. Second run: ----------- For this run, I wanted to render a very large page. I used a 2.5MB html file without images, and only a few tables, displaying 7300 lines of mixed bold, italic, regular text and 2 links for each line. Results: time1 time2 dillo1 13.2s 14.2s dillo2 n/a n/a Legend: - time1 represent the time for starting the browser, wait for rendering to complete, and quit. - time2 represents the time for starting the browser, wait for rendering to complete, then press the pagedown key to scroll all the way down, then quit Conclusion: dillo2 could not complete this test: after a few minutes it started swapping like crazy and used all the memory and cpu. I had to kill it. I aborted this test and did not do mem usage. Third run: ---------- This is a scaled down version of the second run. I took the same file and kept only the first 2000 line. The test file is 684 KB. Results: time1 time2 mem(KB) dillo1 5.1s 35s 12708 dillo2 31.5s 2m53s 33520 Legend: - time1 represent the time for starting the browser, wait for rendering to complete, and quit. - time2 represent the real time for the same operations. I quit the window as soon a the page finished to load (the top-right box was grayed-out) - mem is the memory usage of the page. Conclusion: I like to use dillo to display documentation, and when I do that I always choose the "all in one big page" link, because I know dillo will swallow it without complaining, and I will be able to scroll through it to find what I need. With dillo2, I don't feel confident doing that anymore. Fourth run: ----------- This is the start time test: just display the start screen to see the mem usage. I did this test only because of the failure in the second run. I wanted to know more about the scallabilty issues of dillo2 and I needed a starting point. Result: mem(KB) dillo1 944 dillo2 2148 Conclusion: Dillo2 seems to use much more memory than dillo1 for pure text rendering. Image and other widgets seem to use the same amount of memory. Overall, displaying the same page in dillo2 needs 2 to 3 time more memory than in dillo1. Fifth run: ---------- This is a free run of internet browsing, to get an overall feeling. No numbers for this one. Conclusion: This test confirms the feeling I had throughout this test: dillo2 feels slow and everytime I scroll I find myself waiting the the page to redraw. Maybe I'm just used to dillo1's speed. During my every day usage, starting dillo1 is as fast as starting vi in a console, and you're merely displaying a text file for free. With dillo2, you really feel like you're starting an *application*: it needs a (small) investment (of time) every time. This is a different feeling. Also, I thought the main goal of dillo2 was to display unicode characters. I tried to display asian characters, but I had the same result as dillo1. Is this not coded yet? I though it was free with pango. As for the rendering itself, I must admit that anti-aliasing is nice. Kinda blurry but nice. But the characters are much larger than in dillo1: I had to use font-factor 0.8 for dillo2 and 1.2 for dillo1 to have the same texst height. Final conclusion: ----------------- I don't think I want to give up dillo1's speed for a marginally better rendering. I understand there are asian-fonts patches out there, maybe we could include them as a compile-time option. Being able to render very large documents without dragging the whole system down is also a big plus for me, and dillo2 really disapointed me there. Best, Eric
Hi Eric! Only some remarks about my experiences. I'm only using Gtk 2.0 and Pango 1.0, I'll update to see if it makes a difference. Startup time is a bit difficult to measure, since the disk cache state etc. may influence this. What I found out: - Dillo1 uses libraries which take 4351.38 KB of disk space, while the libs dillo2 uses take 6714.99. For this, I've simpy added the sizes of the files from the output of "ldd". - After having already started both versions, and measured the startup time (with a non-existing file, so that no rendering time can be assumed), dillo2 uses a bit more time (0.11 secs, as opposed to 0.08 secs on my rather new box), which may be due to an increased time for initialization. I've found no difference in drawing time, but this has only played a bit time in dillo1 (at least for text). I've not configured anything for Pango, and from what I see on the screen, anti-aliasing (which may take much time) is turned off. What *does* take far more time is the initial rendering, while rewrapping is exactly as fast as before. This (and also that Pango is only used for drawing, and determing the size of fonts and words) lets me assume that Dw_page_shape_glyphs is not very efficient. I've tried to track down this with gprof, but somehow the profile does not give me much clues. Perhaps it is worth to optimize this code. (The comparison is a bit unfair because of the different grades of matureness :-) Sebastian PS: Like Jorge, I read the list, too :-)
I ran my tests again, only with antialiasing disabled this time (for font sizes between 6 and 14). The results of the first run are repeated here, and dillo2n represents the new runs. Please refer to my previous email for a detailed description of the tests. I also experimented with sub-pixel rendering, without antialiasing (dillo2ns) and with antialiasing (dillo2s) First run: ---------- Results: time1 time2 delta/30 prps mem(KB) dillo1 1.36s 1.82s 15ms 67 2516 dillo2 3.10s 6.90s 126ms 8 3624 dillo2s 3.23s 7.16s 131ms 7.6 n/a dillo2n 3.34s 5.33s 66ms 15 3628 dillo2ns 3.16s 4.94s 59ms 17 n/a Conclusion: While disabling antialiasing rendering doesn't seem to change anything for the start time (which was already acceptable, IMHO), it doubles the speed when scrooling entire pages! With this setting, dillo2n became useable. Not quite as snappy as dillo1 (still 4 times slower on redraws), but very acceptable. Turning off antialiasing doesn't change the amount memory used. Turning on sub-pixel rendering doesn't affect the rendering time, but seems to improve the quality only when used with antialiasing. However, my fonts look ugly with gtk-2.0 and I don't seem to be able to find any setting that helps (it seems to scale non-scalable fonts). With gtk-1.2, the font look good. Second run: skipped. Third run: ---------- This is a scaled down version of the second run. I took the same file and kept only the first 2000 line. The test file is 684 KB. Results: time1 time2 mem(KB) dillo1 5.1s 35s 12708 dillo2 31.5s 2m53s 33520 dillo2n 29.9s n/a 33652 Conclusion: Nothing changed here: loading big pages is still painful brings the whole machine down on its knees when swapping starts. For the record, the real time (time2) was 2m10s, but the load on my system was completely different today, so I don't this it compares to yesterdays results. Fourth run: skipped. Fifth run: ---------- This is a free run of internet browsing, to get an overall feeling. No numbers for this one. Includes browsing several sites, open up to 8 windows, switch between them and close them all, click on the floppy disk to save URL. Selecting text was fast. Conclusion: Still feels heavy. Faster on scrolling, acceptable, in fact, but any operation is still taking enough time for me to notice I'm actually waiting for the redraws to occur. Particularly when overlapping redraws occur (X Expose events), like switching from one window to another. Also, as another poster noticed, *closing* windows takes a significant amount of time (this is certainly related to freeing much more memory than dillo1). I timed another operation to give you an idea: I opened and closed (cancel) the save URL dialog 5 times in dillo2n, substracted the start and closing time as usual and divided by 5: 1.4s each time (user time, real time more like 6s). Same experience with dillo1: 0.09s. Now that's what I'm talking about! (could not get any real time, most of it is spent by moving the mouse from one button to another) Final conclusion: ----------------- If we go with gtk-2.0, we absolutely need to document this antialiasing setting: I had a hard time finding that some information was on fontconfig.org! If we also can point to font de-uglyfication of gtk-2.0, that would help a lot. Regardless, like Stephen said, memory usage is a huge problem. I assume this cause by the libraries and the implementation in dillo is the same (i.e: dillo's structure did not grow x2.5 because the the port). Until this problem is solved, I don't think gtk-2.0 is a viable option for dillo. Disabling antialiasing definitely solves most of my concerns about speed: if only I could get the font to be as clean as gtk-1.2, I would be happy. Best, EG PS: the patch is still alpha-quality and has a lot of rendering bugs: font-factor screws-up positionning, text selection hightlights at the wrong place, etc.
Hi! Just some remarks: - The performance by this patch is indeed not acceptable, so don't be afraid that it gets, *in* *this* *form*, into the main trunk. - However, the patch is immature, so is may still be improved to gain a reasonable performance (and I'm quite certain that the problems may be fixed). I'm in no way familiar with Pango, so someone else may look at it. The main issues are: - It is worth to examine the drawing times more, I found only slight differences. OTOH, Pango configuration seems to be a difficult problem. Certainly, informations about Pango configuration will be displayed in the splash page. - The low speed of page build, and the memory usage: The patch uses PangoGlyphString, while a previous version used PangoLayout. Maybe PangoLayout may faster, this should be tested. As I already wrote, I'm not familiar with Pango, I should look at it soon, but someone with Pango experiences may give some clues. At least, with Pango, TMTOWTDI. On Tue, Oct 14, Jorge Arellano Cid wrote:
I don't know FLTK :(, but here is a list with some preliminary concerns (AFAIK):
* Does it provide C bindings, or is for C++ only? * Does it have a table widget or similar to GTK+'s layout?
GtkLayout is mainly there to overcome the limited size of X windows. When I started to develop Dw, I first tried to get a similar result by writing anything myself, but finally gave it up. Look at the Gtk+ documentation, GtkLayout does some weird things which may not be possible with FLTK. On Tue, Oct 14, Madis Janson wrote:
On Tue, 14 Oct 2003, Eric Gaudet wrote:
Please back your opinions with links, docs, facts or with whatever helps better to understand the point. Maybe a single email can show there's no way to do it, or maybe not!
Two applications I used to run regularly when they were on gtk1.2 were ported to gtk2.0: pan and edonkey2000-gtk.
I'm not using them anymore, because their rendering became painfully slow: scrolling the lists down takes several seconds to refresh on my 300MMX laptop.
I had similar experience with xchat 1.x (based on gtk1.2) and 2.x (gtk2) - text scrolling in 2.x version was noticably slow, when i used it on 200MHz pentium. Even new irc messages caused visible redraw when old messages were scrolled up by 1 line.
Can these problems be fixed with another Pango configuration? On Wed, 15 Oct 2003, Eric Gaudet wrote:
What is the purpose of Dw_page_shape_glyphs?
At least, it is called, whenever a new word is added to the page, and it somehow determines the size of the word. Sebastian
Hello, I have used FLTK a little, and from what I know of it it has less features than GTK, FLTK is probably faster, but GTK was made for GIMP, a drawing program, so I guess it has the functionality you need for a browser. If the current Dillo would be too slow then I would consider switching to FLTK, but not as a upgrade, more a downgrade ;). Though I only know the older FLTK, and not the newer one, so that one may have a lot more functionality. FLTK is written in C++, but you can use it from a C program, or at least you don't have to link to C++ libraries. If your goal is a reasonable fast browser, instead of a very fast one, then I'm afraid I won't use Dillo anymore :(. Looking at the test results, how alpha they may be, I can as well use Firebird. I have two computers, one 233 mhz and one 800 mhz, both are practical GTK2 free, and I would like to keep it that way. The great thing of Dillo is that it's so damn fast, where's the joy if you must wait 3 seconds before it's loaded? If the only reason to switch to GTK2 is to have better fonts support, then I would just stick to GTK 1 and use the freetype library directly, something along the line of prerendered fonts and use them as small pictures, whatever is fastest. Personally I don't need unicode support, can understand that there are a lot people that need or want it, but maybe it's not Dillo's task to support it, maybe a poll on the main website to ask the users about it? For me CSS support is much more important than most other features. I'm digging in Dillo's code to find out a nice way to implement https support, I think the current patch (besides that it's old) is unnecessary big and complicated, I think it can be implemented much cleaner, will post later more about it, probably asking how to handle the variables of the ccc function ;). Greetings, Indan
Hi! I have used FLTK a little too, and i was astonished how fast and easy you get results with it, anyway, i haven't used gtk(2), so i can't compare. But you might look at the Fl_Help_Browser widget. Though the name is somehow disturbing, it's a full featured HTML display widget, which indeed gave some nice results. So much for FLTK not good enough for a browser :) Cheers, johannes
[Thanks Indan for your reply]
If the only reason to switch to GTK2 is to have better fonts support, then I would just stick to GTK 1 and use the freetype library directly, something along the line of prerendered fonts and use them as small pictures, whatever is fastest.
According to http://www.dillo.org/Notes.html, Gtk+ is seen as a mean to support Unicode, not as a mean to display "nice" fonts. But the issue of font rendering speed is also there and as you suggest, these can be optimized depending on context.
Personally I don't need unicode support, can understand that there are a lot people that need or want it, but maybe it's not Dillo's task to support it, maybe a poll on the main website to ask the users about it? For me CSS support is much more important than most other features.
Personnaly, I'd prefere Unicode support (or more precisely multi languages support), than CSS support. I personnaly do not browse only English web pages, and as the Internet is meant to allow information sharing throughout the world, I think Unicode and multi-language support is important. IMO, more important than CSS support, but I let developers decide which is more important and which is easier to implement and which will be implemented first, as each feature depend not only on user wishes but also on available resources. I think Gtk+2 is a nice library which is meant for ease of use and to fullfill most developers wishes in an easy way. This introduces some more abstraction and generalization in the way its widgets are implemented at the cost of specialized and optimized implementations. On modern hardware (>1Ghz, not like my 266Mhz chip), the slower than gtk1.2 library should still be quite usable (although, I did not test it on fast hardware). For example, the GtkTreeView: it is a very flexible widget and provides many features, but it is not a specialized widget anymore, so it is way slower than GtkCList or GtkCTree (AFAIS, it is not used in Thunderbird). Concerning Pango, it has to analyze each string to decide with which rendering engine the string will be rendered, this implies analyzing each character to determine to which language class it belongs, if there are RightToLeft and LeftToRight words etc... Each language may use a different set of fonts, and each font must be checked for its size. This computation is complex so to achieve fast rendering Pango should be studied carefully and rendering or drawing (on the expose events) algorithms should hand crafted. For example, maybe knowing that the page is in a certain non-unicode encoding, we could spare Pango some of its computation if Pango API allows such approach. So to summarize: I think porting Gtk+2 would need a quite deep knowledge of Pango and Gtk2 drawing pipeline and even more efforts on optimizations, as Dillo is meant to be a fast browser before being feature- rich browser. -- Melvin Hadasht
Hi there! Here come the latest news about the FLTK port feasibility analysis. There're lots of issues, but only a few major ones, so trying to be brief: "The main point of joy in dillo is its extraordinary speed." If porting to GTK2 leads to a much slower browser (as for instance like what Eric's tests showed), and with much bigger memory consumption (twice or more as Owen considered plausible), it certainly becomes a big concern. If the difference between using a BIG browser and dillo narrows to the point of making it better to wait for the BIG one and have all the features, dillo becomes irrelevant. (This is a compose statement because it adds the fact that BIG browsers have more features, which is a thing you currently trade-off for the joy of the speed in dillo). At this point, having an FLTK-based dillo starts to be a very interesting option (especially after considering Owen's remarks, the pango issues, and the new expose model in GTK2 which adds a redesign stage for our progressive rendering). Why did we want to go to GTK2? Mainly because of UTF-8 support. Now, I'll quote some very good news from FLTK's maintainer, Michael Sweet: <q> Jorge, I haven't made the official announcement yet, but we've decided to do a 1.2.x version of FLTK that incorporates many of the FLTK 2.0 things using a FLTK 1.x compatible API. Some things of note: - UTF-8 support - Display/print device support (same code that draws to the screen can print to a printer) - 32-bit coordinates - Basic style/scheme/theme API - New menu, browser, table, spinbox, etc. widgets - Better OSX integration using Quartz instead of QuickDraw - Better RGBA image display using Xrender on X11, AlphaBlend on WIN32, and Quartz on OSX when available. The developers of the FLTK UTF-8 and Fl_Device patches will be joining the project, and we have already completed the initial merge to start things off. We'll probably have beta snapshots available before Christmas, with a "gold" release in early 2004. -- ______________________________________________________________________ Michael Sweet, Easy Software Products mike at easysw dot com Printing Software for UNIX http://www.easysw.com </q> So we'd have: UTF-8, 32-bit coordinates, printer!, themes, antialiasing, etc, and with a much leaner engine. Another strong point is that with the new table widget, and the FLTK layout mechanism, much of the complexity in rendering/resize/event-handling/etc can be sent to FLTK instead of having to directly code it in our widgets. <q author="Michael Sweet"> The current FLTK layout mechanism is infinitely flexible, but takes a little getting used to since there are no layout "hints", just resizeable widgets inside groups. In short, you group widgets (and sometimes create empty "box" widgets) to get the layout behavior you want. This is actually a lot faster than the older Motif-style layout stuff that GTK+ uses... There are specialized group widgets (Fl_Pack, Fl_Tile, etc.) that provide for special positioning/resizing capabilities separate from the user resizing the window. </q> Finally, from what I've seen, images can also be "handed" over to FLTK. Avoiding having to decode them into RGB, and manage them inside dillo (png.c, gif.c, jpeg.c, dicache.c, image.c, dw_image.c, ...). This native FLTK images also provide an alpha channel so background images should be easy to implement too. I've been playing with fltk-1.1.4 for a while. It comes with a manual and lots of examples. ftp://ftp.easysw.com/pub/fltk/1.1.4/fltk-1.1.4-source.tar.bz2 (1.3 MB) Just: ./configure --enable-xft make cd test; ./help to have an idea of HTML rendering with antialiased fonts. then: ./demo to get a feel of the widget set. An interesting exercise. Cheers Jorge.- PS: Sebastian: I'm especially interested in your opinion and concerns about this. We have a very interesting opportunity, and we can ask Michael or Bill Spitzak. PS2: dillo-0.8.0 will be GTK1. (probably with kbnav, frames and tabs). (maybe https as explained in a former email)
Jorge Arellano Cid wrote:
Hi there!
Hi!
At this point, having an FLTK-based dillo starts to be a very interesting option (especially after considering Owen's remarks, the pango issues, and the new expose model in GTK2 which adds a redesign stage for our progressive rendering).
Maybe someone that has gtkhtml2 installed can tell us how it compares with respect to the current gtk2 patched Dillo ? I can only experiment with Firebird-gtk2-xft, and I must say that the difference with the gtk1.2 version exist but it way smaller than the difference between dillo-gtk2 and dillo-gtk1. I experimented lately with mlterm, a multilanguage terminal with bidi-support and xft. It is currently slower than xterm+xft and has annonying flickers when scrolling. This makes me feel that the bottleneck will be mainly pango, the drawing path being more easily optimized with proper drawing algorithm. In my app, I had to create a special gtktreeview to have good performance and low memory usage on +1000 items. The optimization was done on the algorithm level and a bit also on the expose path.
Why did we want to go to GTK2? Mainly because of UTF-8 support.
To my eyes, there are two things that are important to allow most people access to Internet: Unicode support and Accessibility functionality. One advantage of GTK2 is proper Unicode support plus a Bidirectional algorithms and text layout and character shaping for many languages. Do you know if fltk2 has bidi support? I could not find any link about this. Another advantage is that when used with Gnome, GTK2 gains accessibility functionality for handicapped persons. I like to think that the kbnav is already one big step toward offering such functionality (perhaps it lacks a way to open context menus), thanks to Frank. But I must say I do not have any experience with Gnome and its accessibility functions.
Finally, from what I've seen, images can also be "handed" over to FLTK. Avoiding having to decode them into RGB, and manage them inside dillo (png.c, gif.c, jpeg.c, dicache.c, image.c, dw_image.c, ...).
Gtk2 comes with gdk-pixbuf. So you only need to pass it a file name or a pointer to a data.
This native FLTK images also provide an alpha channel so background images should be easy to implement too.
Do we really need alpha channel for background images? I mean, background images can drawn before foreground widgets, without the need for alpha channel.
I've been playing with fltk-1.1.4 for a while. It comes with a manual and lots of examples.
I played with version 2 from cvs, and it is amazingly fast. It is a shame that Gtk2 follows the inflation in resource needs like commercial products. -- Melvin Hadasht
Melvin Hadasht wrote:
Another advantage is that when used with Gnome, GTK2 gains accessibility functionality for handicapped persons. I like to think that the kbnav is already one big step toward offering such functionality (perhaps it lacks a way to open context menus), thanks to Frank.
After reading this message I implemented this in the coming version of the patch (available today if I find the time to release it). The default key binding is ALT-Enter (or Alt-KP_Enter). It can be bound to any other key using the appropriate preference setting (see the README documents for more info on this). The menu pops up under the link for keyboard navigation, under the pointer for mouse actions. Any other suggestions to make Dillo more accessible for both non-handicapped and handicapped users? Cheers//Frank -- WWWWW ________________________ ## o o\ / Frank de Lange \ }# \| / +46-734352015 \ \ `--| _/ <Hacker for Hire> \ `---' \ +31-640037120 / \ frank@unternet.org / `------------------------' [ "Omnis enim res, quae dando non deficit, dum habetur et non datur, nondum habetur, quomodo habenda est." ]
participants (8)
-
Eric GAUDET
-
Eric Gaudet
-
Frank de Lange
-
Indan Zupancic
-
johannes leimbach
-
Jorge Arellano Cid
-
Melvin Hadasht
-
Sebastian Geerken