Dillo-dev
By thread
dillo-dev@mailman3.com
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1999 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1998 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1997 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1996 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1995 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 2 participants
- 11670 messages
Memory usage
by jcidï¼ dillo.org
Hi there,
I've been reviewing memory usage these days, and found some
weird numbers that I'd like to understand.
Taking the huge mysql page (13MB), I made the following
memory measures (with ps). Load a bare dillo, load the simple
directory where the huge page is located, then the huge page,
then back, then forward, back, forward and back.
I did this for dillo2.19Jun, dillo2.21Jun, dillo-fltk (with
zone allocators) and dillo1. All in GNU/Linux with image_off.
Here are the numbers:
-----------
Memory test
-----------
%MEM VSZ RSS TTY STAT START TIME COMMAND
0.1 9672 4144 pts/10 S+ 09:37 0:00 ./dillo-fltk.19Jun bare
0.2 10376 4756 pts/10 S+ 09:37 0:00 ./dillo-fltk.19Jun dir list
6.9 176176 144776 pts/10 S+ 09:37 0:02 ./dillo-fltk.19Jun huge page
5.4 123556 113216 pts/10 S+ 09:37 0:02 ./dillo-fltk.19Jun back
7.0 176176 146240 pts/10 S+ 09:37 0:05 ./dillo-fltk.19Jun forward
5.6 127020 117720 pts/10 S+ 09:37 0:05 ./dillo-fltk.19Jun back
7.0 176172 146240 pts/10 S+ 09:37 0:07 ./dillo-fltk.19Jun forward
5.6 127016 117716 pts/10 S+ 09:37 0:08 ./dillo-fltk.19Jun back
%MEM VSZ RSS TTY STAT START TIME COMMAND
0.1 9672 4140 pts/10 S+ 09:26 0:00 ./dillo-fltk.21Jun bare
0.2 10376 4760 pts/10 S+ 09:26 0:00 ./dillo-fltk.21Jun dir list
5.9 147904 123988 pts/10 S+ 09:31 0:02 ./dillo-fltk.21Jun huge page
4.9 111668 101944 pts/10 S+ 09:31 0:02 ./dillo-fltk.21Jun back
6.0 147780 124792 pts/10 S+ 09:31 0:05 ./dillo-fltk.21Jun forward
5.0 115008 105780 pts/10 S+ 09:31 0:05 ./dillo-fltk.21Jun back
6.0 147780 124856 pts/10 S+ 09:31 0:07 ./dillo-fltk.21Jun forward
5.1 115008 105844 pts/10 S+ 09:31 0:07 ./dillo-fltk.21Jun back
%MEM VSZ RSS TTY STAT START TIME COMMAND
0.1 9676 4084 pts/10 S+ 11:16 0:00 ./dillo-fltk bare
0.2 10464 4768 pts/10 S+ 11:17 0:00 ./dillo-fltk dir list
5.4 136960 112920 pts/10 S+ 11:17 0:04 ./dillo-fltk huge page
4.3 100724 90864 pts/10 S+ 11:17 0:04 ./dillo-fltk back
5.4 136952 113756 pts/10 S+ 11:17 0:09 ./dillo-fltk forward
4.5 104180 94744 pts/10 S+ 11:17 0:09 ./dillo-fltk back
5.4 136888 113776 pts/10 S+ 11:17 0:13 ./dillo-fltk forward
4.5 104116 94764 pts/10 S+ 11:17 0:14 ./dillo-fltk back
%MEM VSZ RSS TTY STAT START TIME COMMAND
0.1 8408 3524 pts/10 S+ 10:59 0:00 ./dillo1 bare
0.1 24788 3564 pts/10 S+ 11:01 0:00 ./dillo1 dir list
8.7 226996 182220 pts/10 S+ 11:01 0:07 ./dillo1 huge page
6.8 165880 141792 pts/10 S+ 11:01 0:09 ./dillo1 back
8.8 226952 184176 pts/10 S+ 11:01 0:17 ./dillo1 forward
6.9 166264 144024 pts/10 S+ 11:01 0:18 ./dillo1 back
8.8 226968 184216 pts/10 S+ 11:01 0:26 ./dillo1 forward
6.9 166264 144060 pts/10 S+ 11:01 0:27 ./dillo1 back
Besides showing clearly a sane memory usage reduction pattern,
there's a strange fact I don't understand. Once back from the
huge page, I'd expect memory usage to drop to what it was before
plus the 13MB of cached data, plus some KB of overhead, BUT the
RSS keeps near 90MB.
This happens with dillo1 too.
My thoughts:
* If this memory is not freed, it'd be great to find the huge
leak.
* If it's freed but not returned to the OS., dillo would
consume as much memory as the biggest page it has loaded.
Clearly not a desirable situation.
* It may be that the O.S. knows it can claim back this memory
when necessary but prefers to keep it assigned to the
same process until it finds better use for it.
-------------------------------------------
Huge page with different memory allocators:
-------------------------------------------
%MEM VSZ RSS TTY STAT START TIME COMMAND
5.4 134912 113740 pts/17 S+ 18:56 0:02 ./dillo-fltk step: 2x
5.4 134916 113752 pts/17 S+ 18:57 0:02 ./dillo-fltk step: 2x
5.4 134828 113660 pts/17 S+ 18:58 0:02 ./dillo-fltk step: 2x
5.0 114940 105432 pts/17 S+ 18:53 0:02 ./dillo-fltk step: 1
5.0 111976 105488 pts/17 S+ 18:54 0:03 ./dillo-fltk step: 1
5.0 114872 105416 pts/17 S+ 18:54 0:02 ./dillo-fltk step: 1
5.1 117796 106436 pts/17 S+ 18:59 0:02 ./dillo-fltk step: cst
5.1 117568 106404 pts/17 S+ 19:00 0:02 ./dillo-fltk step: cst
5.1 117820 106460 pts/17 S+ 19:00 0:02 ./dillo-fltk step: cst
This data comes from a memory usage reduction by tunning the
simpleVector memory allocator. The first is the current one,
which allocates in chunks of 2*numAlloc, the second allocates one
by one and the third is a custom one I made.
The 1-allocator is the best memory usage reducer but it's
slower (roughly 20%). The cst-allocator reduces a bit less but is
almost as fast as the 2x-allocator (2% slower or so).
Memory reduction:
VSZ RSS
-----------------------------
1-allocator 15% 7.3%
cst-allocator 13% 6.5%
-----------------------------
Well, compared with the 1000% "leak" above... :-)
--
Cheers
Jorge.-
June 22, 2008
Textblock::addText()
by jcidï¼ dillo.org
On Sat, Jun 21, 2008 at 11:12:34PM +0200, Johannes Hofmann wrote:
> On Sat, Jun 21, 2008 at 04:58:50PM -0400, Jorge Arellano Cid wrote:
> > On Sat, Jun 21, 2008 at 10:36:52PM +0200, Johannes Hofmann wrote:
> > > On Sat, Jun 21, 2008 at 02:38:48PM -0400, Jorge Arellano Cid wrote:
> > > > On Sat, Jun 21, 2008 at 06:23:18PM +0200, Johannes Hofmann wrote:
> > > > > On Sat, Jun 21, 2008 at 11:31:56AM -0400, Jorge Arellano Cid wrote:
> > > > > > On Fri, Jun 20, 2008 at 08:45:18PM +0200, Johannes Hofmann wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > On Fri, Jun 20, 2008 at 01:03:26PM -0400, Jorge Arellano Cid wrote:
> > > > > > > > Hi there,
> > > > > > > >
> > > > > > > > - Changed Textblock::addText() to internally allocate its text string,
> > > > > > > > making the memory handling opaque to the caller.
> > > > > > > >
> > > > > > > > Does anybody remmeber the topic of addText() deleting a malloc'ed
> > > > > > > > block of memory?
> > > > > > > >
> > > > > > > > I decided to make the change for API cleanliness/correctness and set
> > > > > > > > the Textblock do the whole memory handling (i.e. now the Textblock is
> > > > > > > > the one that allocates/deallocates the text string).
> > > > > > > >
> > > > > > > > The HTML parser was adjusted a bit to keep its old performance.
> > > > > > >
> > > > > > > Very nice!
> > > > > > > I thought this is the right moment to drag out my old text
> > > > > > > allocation optimization.
> > > > > > > And now it really makes a difference.
> > > > > > > I see about 10M less memory usage on the mysql page and most
> > > > > > > important, leaving that huge page is quite a bit faster - as there
> > > > > > > is less free() calls.
> > > > > > > The result may be completely different on Linux however. So please
> > > > > > > give it a try on Linux.
> > > > > >
> > > > > > Here I have:
> > > > > >
> > > > > > Platform: Debian GNU/Linux, dillo-fltk with image_off
> > > > > > Test : huge mysql page
> > > > > >
> > > > > > %MEM VSZ RSS TTY STAT START TIME COMMAND
> > > > > > 0.1 9672 4144 pts/10 S+ 08:51 0:00 ./dillo-fltk.21Jun
> > > > > > 5.9 147588 123896 pts/10 S+ 08:51 0:02 ./dillo-fltk.21Jun
> > > > > >
> > > > > > 0.1 9676 4136 pts/17 S+ 08:54 0:00 ./dillo-fltk
> > > > > > 5.4 136684 112872 pts/17 S+ 08:54 0:02 ./dillo-fltk
> > > > > >
> > > > > > This is roughly 10% of memory usage reduction.
> > > > > >
> > > > > > Committed.
> > > > >
> > > > > In this case I have a little cleanup.
> > > > > This patch also avoids one strlen() per added word.
> > > >
> > > > How much is the speed gain?
> > >
> > > I can't see much of a difference. I'm trying with:
> > >
> > > --- a/src/html.ccSat Jun 21 15:00:35 2008 +0200
> > > +++ b/src/html.ccSat Jun 21 22:27:30 2008 +0200
> > > @@ -672,6 +672,7 @@ void DilloHtml::finishParsing(int Client
> > >
> > > freeParseData();
> > > parse_finished = true;
> > > +exit(0);
> > > }
> > >
> > > /*
> > >
> > > and then
> > >
> > > time dillo-fltk manual.html, but the numbers are varying greatly -
> > > at least more than the speed gain, if there is any.
> > > Do you know a better method to measure the performance? perhaps
> > > parsing the document 10 times in a loop?
> >
> > I get consistent timing with uicmd.cc:647 set to 1.
>
> But that only works with images enabled, right? Then all timings are
> dominated by image decoding. Without images I get timings around 3s
> with images it's about 16s.
> But anyway, I agree that there is not much gain in avoiding that
> strlen call. So let's just forget about that for now. If we can find
> a test case where it really helps, we can come back to it.
Sorry, I just committed a halt that works both with/without images.
(same line).
I'm investigating on memory usage, and have further reduced it,
but what I'm about to post for discussion is really weird.
Stay tuned...
--
Cheers
Jorge.-
June 22, 2008
Textblock::addText()
by Johannes.Hofmannï¼ gmx.de
On Sat, Jun 21, 2008 at 04:58:50PM -0400, Jorge Arellano Cid wrote:
> On Sat, Jun 21, 2008 at 10:36:52PM +0200, Johannes Hofmann wrote:
> > On Sat, Jun 21, 2008 at 02:38:48PM -0400, Jorge Arellano Cid wrote:
> > > On Sat, Jun 21, 2008 at 06:23:18PM +0200, Johannes Hofmann wrote:
> > > > On Sat, Jun 21, 2008 at 11:31:56AM -0400, Jorge Arellano Cid wrote:
> > > > > On Fri, Jun 20, 2008 at 08:45:18PM +0200, Johannes Hofmann wrote:
> > > > > > Hi,
> > > > > >
> > > > > > On Fri, Jun 20, 2008 at 01:03:26PM -0400, Jorge Arellano Cid wrote:
> > > > > > > Hi there,
> > > > > > >
> > > > > > > - Changed Textblock::addText() to internally allocate its text string,
> > > > > > > making the memory handling opaque to the caller.
> > > > > > >
> > > > > > > Does anybody remmeber the topic of addText() deleting a malloc'ed
> > > > > > > block of memory?
> > > > > > >
> > > > > > > I decided to make the change for API cleanliness/correctness and set
> > > > > > > the Textblock do the whole memory handling (i.e. now the Textblock is
> > > > > > > the one that allocates/deallocates the text string).
> > > > > > >
> > > > > > > The HTML parser was adjusted a bit to keep its old performance.
> > > > > >
> > > > > > Very nice!
> > > > > > I thought this is the right moment to drag out my old text
> > > > > > allocation optimization.
> > > > > > And now it really makes a difference.
> > > > > > I see about 10M less memory usage on the mysql page and most
> > > > > > important, leaving that huge page is quite a bit faster - as there
> > > > > > is less free() calls.
> > > > > > The result may be completely different on Linux however. So please
> > > > > > give it a try on Linux.
> > > > >
> > > > > Here I have:
> > > > >
> > > > > Platform: Debian GNU/Linux, dillo-fltk with image_off
> > > > > Test : huge mysql page
> > > > >
> > > > > %MEM VSZ RSS TTY STAT START TIME COMMAND
> > > > > 0.1 9672 4144 pts/10 S+ 08:51 0:00 ./dillo-fltk.21Jun
> > > > > 5.9 147588 123896 pts/10 S+ 08:51 0:02 ./dillo-fltk.21Jun
> > > > >
> > > > > 0.1 9676 4136 pts/17 S+ 08:54 0:00 ./dillo-fltk
> > > > > 5.4 136684 112872 pts/17 S+ 08:54 0:02 ./dillo-fltk
> > > > >
> > > > > This is roughly 10% of memory usage reduction.
> > > > >
> > > > > Committed.
> > > >
> > > > In this case I have a little cleanup.
> > > > This patch also avoids one strlen() per added word.
> > >
> > > How much is the speed gain?
> >
> > I can't see much of a difference. I'm trying with:
> >
> > --- a/src/html.ccSat Jun 21 15:00:35 2008 +0200
> > +++ b/src/html.ccSat Jun 21 22:27:30 2008 +0200
> > @@ -672,6 +672,7 @@ void DilloHtml::finishParsing(int Client
> >
> > freeParseData();
> > parse_finished = true;
> > +exit(0);
> > }
> >
> > /*
> >
> > and then
> >
> > time dillo-fltk manual.html, but the numbers are varying greatly -
> > at least more than the speed gain, if there is any.
> > Do you know a better method to measure the performance? perhaps
> > parsing the document 10 times in a loop?
>
> I get consistent timing with uicmd.cc:647 set to 1.
But that only works with images enabled, right? Then all timings are
dominated by image decoding. Without images I get timings around 3s
with images it's about 16s.
But anyway, I agree that there is not much gain in avoiding that
strlen call. So let's just forget about that for now. If we can find
a test case where it really helps, we can come back to it.
Cheers,
Johannes
June 21, 2008
Textblock::addText()
by jcidï¼ dillo.org
On Sat, Jun 21, 2008 at 10:36:52PM +0200, Johannes Hofmann wrote:
> On Sat, Jun 21, 2008 at 02:38:48PM -0400, Jorge Arellano Cid wrote:
> > On Sat, Jun 21, 2008 at 06:23:18PM +0200, Johannes Hofmann wrote:
> > > On Sat, Jun 21, 2008 at 11:31:56AM -0400, Jorge Arellano Cid wrote:
> > > > On Fri, Jun 20, 2008 at 08:45:18PM +0200, Johannes Hofmann wrote:
> > > > > Hi,
> > > > >
> > > > > On Fri, Jun 20, 2008 at 01:03:26PM -0400, Jorge Arellano Cid wrote:
> > > > > > Hi there,
> > > > > >
> > > > > > - Changed Textblock::addText() to internally allocate its text string,
> > > > > > making the memory handling opaque to the caller.
> > > > > >
> > > > > > Does anybody remmeber the topic of addText() deleting a malloc'ed
> > > > > > block of memory?
> > > > > >
> > > > > > I decided to make the change for API cleanliness/correctness and set
> > > > > > the Textblock do the whole memory handling (i.e. now the Textblock is
> > > > > > the one that allocates/deallocates the text string).
> > > > > >
> > > > > > The HTML parser was adjusted a bit to keep its old performance.
> > > > >
> > > > > Very nice!
> > > > > I thought this is the right moment to drag out my old text
> > > > > allocation optimization.
> > > > > And now it really makes a difference.
> > > > > I see about 10M less memory usage on the mysql page and most
> > > > > important, leaving that huge page is quite a bit faster - as there
> > > > > is less free() calls.
> > > > > The result may be completely different on Linux however. So please
> > > > > give it a try on Linux.
> > > >
> > > > Here I have:
> > > >
> > > > Platform: Debian GNU/Linux, dillo-fltk with image_off
> > > > Test : huge mysql page
> > > >
> > > > %MEM VSZ RSS TTY STAT START TIME COMMAND
> > > > 0.1 9672 4144 pts/10 S+ 08:51 0:00 ./dillo-fltk.21Jun
> > > > 5.9 147588 123896 pts/10 S+ 08:51 0:02 ./dillo-fltk.21Jun
> > > >
> > > > 0.1 9676 4136 pts/17 S+ 08:54 0:00 ./dillo-fltk
> > > > 5.4 136684 112872 pts/17 S+ 08:54 0:02 ./dillo-fltk
> > > >
> > > > This is roughly 10% of memory usage reduction.
> > > >
> > > > Committed.
> > >
> > > In this case I have a little cleanup.
> > > This patch also avoids one strlen() per added word.
> >
> > How much is the speed gain?
>
> I can't see much of a difference. I'm trying with:
>
> --- a/src/html.ccSat Jun 21 15:00:35 2008 +0200
> +++ b/src/html.ccSat Jun 21 22:27:30 2008 +0200
> @@ -672,6 +672,7 @@ void DilloHtml::finishParsing(int Client
>
> freeParseData();
> parse_finished = true;
> +exit(0);
> }
>
> /*
>
> and then
>
> time dillo-fltk manual.html, but the numbers are varying greatly -
> at least more than the speed gain, if there is any.
> Do you know a better method to measure the performance? perhaps
> parsing the document 10 times in a loop?
I get consistent timing with uicmd.cc:647 set to 1.
--
Cheers
Jorge.-
June 21, 2008
Textblock::addText()
by Johannes.Hofmannï¼ gmx.de
On Sat, Jun 21, 2008 at 02:38:48PM -0400, Jorge Arellano Cid wrote:
> On Sat, Jun 21, 2008 at 06:23:18PM +0200, Johannes Hofmann wrote:
> > On Sat, Jun 21, 2008 at 11:31:56AM -0400, Jorge Arellano Cid wrote:
> > > On Fri, Jun 20, 2008 at 08:45:18PM +0200, Johannes Hofmann wrote:
> > > > Hi,
> > > >
> > > > On Fri, Jun 20, 2008 at 01:03:26PM -0400, Jorge Arellano Cid wrote:
> > > > > Hi there,
> > > > >
> > > > > - Changed Textblock::addText() to internally allocate its text string,
> > > > > making the memory handling opaque to the caller.
> > > > >
> > > > > Does anybody remmeber the topic of addText() deleting a malloc'ed
> > > > > block of memory?
> > > > >
> > > > > I decided to make the change for API cleanliness/correctness and set
> > > > > the Textblock do the whole memory handling (i.e. now the Textblock is
> > > > > the one that allocates/deallocates the text string).
> > > > >
> > > > > The HTML parser was adjusted a bit to keep its old performance.
> > > >
> > > > Very nice!
> > > > I thought this is the right moment to drag out my old text
> > > > allocation optimization.
> > > > And now it really makes a difference.
> > > > I see about 10M less memory usage on the mysql page and most
> > > > important, leaving that huge page is quite a bit faster - as there
> > > > is less free() calls.
> > > > The result may be completely different on Linux however. So please
> > > > give it a try on Linux.
> > >
> > > Here I have:
> > >
> > > Platform: Debian GNU/Linux, dillo-fltk with image_off
> > > Test : huge mysql page
> > >
> > > %MEM VSZ RSS TTY STAT START TIME COMMAND
> > > 0.1 9672 4144 pts/10 S+ 08:51 0:00 ./dillo-fltk.21Jun
> > > 5.9 147588 123896 pts/10 S+ 08:51 0:02 ./dillo-fltk.21Jun
> > >
> > > 0.1 9676 4136 pts/17 S+ 08:54 0:00 ./dillo-fltk
> > > 5.4 136684 112872 pts/17 S+ 08:54 0:02 ./dillo-fltk
> > >
> > > This is roughly 10% of memory usage reduction.
> > >
> > > Committed.
> >
> > In this case I have a little cleanup.
> > This patch also avoids one strlen() per added word.
>
> How much is the speed gain?
I can't see much of a difference. I'm trying with:
--- a/src/html.ccSat Jun 21 15:00:35 2008 +0200
+++ b/src/html.ccSat Jun 21 22:27:30 2008 +0200
@@ -672,6 +672,7 @@ void DilloHtml::finishParsing(int Client
freeParseData();
parse_finished = true;
+exit(0);
}
/*
and then
time dillo-fltk manual.html, but the numbers are varying greatly -
at least more than the speed gain, if there is any.
Do you know a better method to measure the performance? perhaps
parsing the document 10 times in a loop?
>
> I hesitate because this adds the overhead of one extra
> parameter per word. Well, let's look at the numbers.
>
> You can test by overloading addText and changing the html.cc:1195 call.
Cheers,
Johannes
June 21, 2008
Textblock::addText()
by jcidï¼ dillo.org
On Sat, Jun 21, 2008 at 06:23:18PM +0200, Johannes Hofmann wrote:
> On Sat, Jun 21, 2008 at 11:31:56AM -0400, Jorge Arellano Cid wrote:
> > On Fri, Jun 20, 2008 at 08:45:18PM +0200, Johannes Hofmann wrote:
> > > Hi,
> > >
> > > On Fri, Jun 20, 2008 at 01:03:26PM -0400, Jorge Arellano Cid wrote:
> > > > Hi there,
> > > >
> > > > - Changed Textblock::addText() to internally allocate its text string,
> > > > making the memory handling opaque to the caller.
> > > >
> > > > Does anybody remmeber the topic of addText() deleting a malloc'ed
> > > > block of memory?
> > > >
> > > > I decided to make the change for API cleanliness/correctness and set
> > > > the Textblock do the whole memory handling (i.e. now the Textblock is
> > > > the one that allocates/deallocates the text string).
> > > >
> > > > The HTML parser was adjusted a bit to keep its old performance.
> > >
> > > Very nice!
> > > I thought this is the right moment to drag out my old text
> > > allocation optimization.
> > > And now it really makes a difference.
> > > I see about 10M less memory usage on the mysql page and most
> > > important, leaving that huge page is quite a bit faster - as there
> > > is less free() calls.
> > > The result may be completely different on Linux however. So please
> > > give it a try on Linux.
> >
> > Here I have:
> >
> > Platform: Debian GNU/Linux, dillo-fltk with image_off
> > Test : huge mysql page
> >
> > %MEM VSZ RSS TTY STAT START TIME COMMAND
> > 0.1 9672 4144 pts/10 S+ 08:51 0:00 ./dillo-fltk.21Jun
> > 5.9 147588 123896 pts/10 S+ 08:51 0:02 ./dillo-fltk.21Jun
> >
> > 0.1 9676 4136 pts/17 S+ 08:54 0:00 ./dillo-fltk
> > 5.4 136684 112872 pts/17 S+ 08:54 0:02 ./dillo-fltk
> >
> > This is roughly 10% of memory usage reduction.
> >
> > Committed.
>
> In this case I have a little cleanup.
> This patch also avoids one strlen() per added word.
How much is the speed gain?
I hesitate because this adds the overhead of one extra
parameter per word. Well, let's look at the numbers.
You can test by overloading addText and changing the html.cc:1195 call.
--
Cheers
Jorge.-
June 21, 2008
Textblock::addText()
by Johannes.Hofmannï¼ gmx.de
On Sat, Jun 21, 2008 at 11:31:56AM -0400, Jorge Arellano Cid wrote:
> On Fri, Jun 20, 2008 at 08:45:18PM +0200, Johannes Hofmann wrote:
> > Hi,
> >
> > On Fri, Jun 20, 2008 at 01:03:26PM -0400, Jorge Arellano Cid wrote:
> > > Hi there,
> > >
> > > - Changed Textblock::addText() to internally allocate its text string,
> > > making the memory handling opaque to the caller.
> > >
> > > Does anybody remmeber the topic of addText() deleting a malloc'ed
> > > block of memory?
> > >
> > > I decided to make the change for API cleanliness/correctness and set
> > > the Textblock do the whole memory handling (i.e. now the Textblock is
> > > the one that allocates/deallocates the text string).
> > >
> > > The HTML parser was adjusted a bit to keep its old performance.
> >
> > Very nice!
> > I thought this is the right moment to drag out my old text
> > allocation optimization.
> > And now it really makes a difference.
> > I see about 10M less memory usage on the mysql page and most
> > important, leaving that huge page is quite a bit faster - as there
> > is less free() calls.
> > The result may be completely different on Linux however. So please
> > give it a try on Linux.
>
> Here I have:
>
> Platform: Debian GNU/Linux, dillo-fltk with image_off
> Test : huge mysql page
>
> %MEM VSZ RSS TTY STAT START TIME COMMAND
> 0.1 9672 4144 pts/10 S+ 08:51 0:00 ./dillo-fltk.21Jun
> 5.9 147588 123896 pts/10 S+ 08:51 0:02 ./dillo-fltk.21Jun
>
> 0.1 9676 4136 pts/17 S+ 08:54 0:00 ./dillo-fltk
> 5.4 136684 112872 pts/17 S+ 08:54 0:02 ./dillo-fltk
>
> This is roughly 10% of memory usage reduction.
>
> Committed.
In this case I have a little cleanup.
This patch also avoids one strlen() per added word.
Cheers,
Johannes
June 21, 2008
Textblock::addText()
by jcidï¼ dillo.org
On Sat, Jun 21, 2008 at 11:31:56AM -0400, Jorge Arellano Cid wrote:
> Here I have:
>
> Platform: Debian GNU/Linux, dillo-fltk with image_off
> Test : huge mysql page
>
> %MEM VSZ RSS TTY STAT START TIME COMMAND
> 0.1 9672 4144 pts/10 S+ 08:51 0:00 ./dillo-fltk.21Jun
> 5.9 147588 123896 pts/10 S+ 08:51 0:02 ./dillo-fltk.21Jun
>
> 0.1 9676 4136 pts/17 S+ 08:54 0:00 ./dillo-fltk
> 5.4 136684 112872 pts/17 S+ 08:54 0:02 ./dillo-fltk
>
> This is roughly 10% of memory usage reduction.
>
> Committed.
BTW, here there is no noticeable speedup on leaving the page,
and it is quite fast.
--
Cheers
Jorge.-
June 21, 2008
Textblock::addText()
by jcidï¼ dillo.org
On Fri, Jun 20, 2008 at 08:45:18PM +0200, Johannes Hofmann wrote:
> Hi,
>
> On Fri, Jun 20, 2008 at 01:03:26PM -0400, Jorge Arellano Cid wrote:
> > Hi there,
> >
> > - Changed Textblock::addText() to internally allocate its text string,
> > making the memory handling opaque to the caller.
> >
> > Does anybody remmeber the topic of addText() deleting a malloc'ed
> > block of memory?
> >
> > I decided to make the change for API cleanliness/correctness and set
> > the Textblock do the whole memory handling (i.e. now the Textblock is
> > the one that allocates/deallocates the text string).
> >
> > The HTML parser was adjusted a bit to keep its old performance.
>
> Very nice!
> I thought this is the right moment to drag out my old text
> allocation optimization.
> And now it really makes a difference.
> I see about 10M less memory usage on the mysql page and most
> important, leaving that huge page is quite a bit faster - as there
> is less free() calls.
> The result may be completely different on Linux however. So please
> give it a try on Linux.
Here I have:
Platform: Debian GNU/Linux, dillo-fltk with image_off
Test : huge mysql page
%MEM VSZ RSS TTY STAT START TIME COMMAND
0.1 9672 4144 pts/10 S+ 08:51 0:00 ./dillo-fltk.21Jun
5.9 147588 123896 pts/10 S+ 08:51 0:02 ./dillo-fltk.21Jun
0.1 9676 4136 pts/17 S+ 08:54 0:00 ./dillo-fltk
5.4 136684 112872 pts/17 S+ 08:54 0:02 ./dillo-fltk
This is roughly 10% of memory usage reduction.
Committed.
--
Cheers
Jorge.-
June 21, 2008
Splitting html.cc: what next?
by jcidï¼ dillo.org
On Fri, Jun 20, 2008 at 09:26:32PM +0100, Jeremy Henty wrote:
> [...]
> Fair enough. What was the decision about splitting off table.cc ? I
> sent in the patch but it hasn't appeared in CVS and I've not seen a
> response. I don't particularly mind either way, but it would be
> useful to know whether it's going to happen.
Ooops, I skipped over it unintentionally.
Thanks for the reminder.
Committed.
--
Cheers
Jorge.-
June 21, 2008