kjs math_object micro optimization?

Luciano Montanaro mikelima at virgilio.it
Mon May 19 14:43:58 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

14:05, lunedì 19 maggio 2003, skrev David Faure:

> I checked those results initially, but not every time we add a new property
> :) Feel free to commit, but I don't think the Math object is accessed
> _that_ often, that it will really make any speed difference?

Ok. I imagined that was the case, but since I am creating a custom javascript 
class I wanted a confirmation. The math class should not be called so often 
indeed. It just happened to be the one I tried to create an hash table for,
and the results puzzled me. Since I don't think the javascript keywords to 
change too soon however, I'd like to commit the following changes to slightly 
reduce the hash table collisions in the kjs directory. 

Luciano

? collector-cpp.patch
? lut.diff
? math_object.patch
Index: array_object.cpp
===================================================================
RCS file: /home/kde/kdelibs/kjs/array_object.cpp,v
retrieving revision 1.52
diff -u -r1.52 array_object.cpp
- --- array_object.cpp	18 Apr 2003 12:56:52 -0000	1.52
+++ array_object.cpp	19 May 2003 13:39:19 -0000
@@ -391,7 +391,7 @@
 const ClassInfo ArrayPrototypeImp::info = {"Array", &ArrayInstanceImp::info, 
&arrayTable, 0};
 
 /* Source for array_object.lut.h
- - at begin arrayTable 13
+ at begin arrayTable 17
   toString       ArrayProtoFuncImp::ToString       DontEnum|Function 0
   toLocaleString ArrayProtoFuncImp::ToLocaleString DontEnum|Function 0
   concat         ArrayProtoFuncImp::Concat         DontEnum|Function 0
Index: keywords.table
===================================================================
RCS file: /home/kde/kdelibs/kjs/keywords.table,v
retrieving revision 1.1
diff -u -r1.1 keywords.table
- --- keywords.table	30 May 2001 19:06:07 -0000	1.1
+++ keywords.table	19 May 2003 13:39:19 -0000
@@ -1,5 +1,5 @@
 # main keywords
- - at begin mainTable 41
+ at begin mainTable 44
 # types
 null		NULLTOKEN
 true		TRUETOKEN
Index: math_object.cpp
===================================================================
RCS file: /home/kde/kdelibs/kjs/math_object.cpp,v
retrieving revision 1.33
diff -u -r1.33 math_object.cpp
- --- math_object.cpp	18 Apr 2003 08:29:49 -0000	1.33
+++ math_object.cpp	19 May 2003 13:39:19 -0000
@@ -44,7 +44,7 @@
 const ClassInfo MathObjectImp::info = { "Math", 0, &mathTable, 0 };
 
 /* Source for math_object.lut.h
- - at begin mathTable 21
+ at begin mathTable 31
   E             MathObjectImp::Euler    DontEnum|DontDelete|ReadOnly
   LN2           MathObjectImp::Ln2      DontEnum|DontDelete|ReadOnly
   LN10          MathObjectImp::Ln10     DontEnum|DontDelete|ReadOnly
Index: string_object.cpp
===================================================================
RCS file: /home/kde/kdelibs/kjs/string_object.cpp,v
retrieving revision 1.76
diff -u -r1.76 string_object.cpp
- --- string_object.cpp	18 Apr 2003 12:56:52 -0000	1.76
+++ string_object.cpp	19 May 2003 13:39:19 -0000
@@ -114,7 +114,7 @@
 // ------------------------------ StringPrototypeImp 
- ---------------------------
 const ClassInfo StringPrototypeImp::info = {"String", 
&StringInstanceImp::info, &stringTable, 0};
 /* Source for string_object.lut.h
- - at begin stringTable 26
+ at begin stringTable 28
   toString		StringProtoFuncImp::ToString	DontEnum|Function	0
   valueOf		StringProtoFuncImp::ValueOf	DontEnum|Function	0
   charAt		StringProtoFuncImp::CharAt	DontEnum|Function	1

- -- 
Luciano Montanaro// My public GPG key can be  /"\ ASCII RIBBON
               \X/ found at wwwkeys.pgp.net   \ /   CAMPAIGN
                                               X  AGAINST HTML 
                                              / \     MAIL
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+yN+kaeOY6B53J4URAl8PAJ4k1Rx6CnoRJ+L8TOp+SRflHK3qkACfeMs5
pvEcA8LVwLVk/NuTjBozMG0=
=F4oR
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list