JS speed - Konq vs. Mozilla

Koos Vriezen koos.vriezen at xs4all.nl
Mon Sep 16 21:57:00 BST 2002


On Sun, 8 Sep 2002, Koos Vriezen wrote:

> On Sun, 8 Sep 2002, Dirk Mueller wrote:
>
> > On Sam, 07 Sep 2002, Koos Vriezen wrote:
> >
> > > Still, I'm not sure why its faster. Maybe its the 'Collector::collect()'
> > > that's faster in the next run (less blocks).
> >
> > Profilling the collect() step, it seems the biggest problem is the massive
> > amount of cache misses it produces, that is over 78% of all (of testkhtml).
>
> Has collect() the most impact on the speed? I had the impression it was
> allocate(int size).
>
> > It might be better to put the ValueImp flags into a separate, continuous
> > memory region, because the current pointer following causes it to refetch
> > all allocated memory regions into the CPU cache, which is extremely slow.
> > Also, as the allocated regions are a multiple of the cache association size,
> > this currently screams for caching problems.
> >
> > Do you want to try that (allocating a separate bitarray for those flags) ?
>
> Hmmm, looked at it but it's not easy.

Attached is another approach, allocate the contents of a whole block in
one continuous memory region. It does improve speed with about 6%, but it
might be because it does do alot less malloc's.
Patch may need some more tuning, but it seems pretty stable.

Koos

-------------- next part --------------
Index: collector.h
===================================================================
RCS file: /home/kde/kdelibs/kjs/collector.h,v
retrieving revision 1.16
diff -u -3 -p -r1.16 collector.h
--- collector.h	2002/06/19 08:20:59	1.16
+++ collector.h	2002/09/16 20:47:06
@@ -96,8 +96,9 @@ namespace KJS {
     static unsigned long softLimit;
     static unsigned long timesFilled;
     static unsigned long increaseLimitAt;
+    static unsigned long alignment;
     static bool memLimitReached;
-    enum { BlockSize = 100 };
+    enum { BlockSize = 3800 };
   };
 
 };
-------------- next part --------------
A non-text attachment was scrubbed...
Name: collector.cpp.gz
Type: application/x-gunzip
Size: 4208 bytes
Desc: 
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20020916/8ace06e5/attachment.bin>


More information about the kfm-devel mailing list