[kaffe] Some optimization patches
Jukka Santala
jsantala@morphine.tml.hut.fi
Thu, 12 Sep 2002 14:06:25 +0300 (EEST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---559023410-1804928587-1031828785=:26878
Content-Type: TEXT/PLAIN; charset=US-ASCII
Don't recall if I posted any fo these patches before summer vacation, but
I'm posting them now anyway as a part of the "autumn cleanup" ;)
kaffe-donwulff-sanitychk.patch
Turns off the so-called "Sanity check" code from the VM core by
default. These checks are no doubt useful, if something goes drastically
wrong, but considering things don't usually go wrong (that way), they
instead drastically slow down the VM core. Most users want to run with
these disabled; the only reason to have them turned on is if you're
porting or doing other critical VM rework, and want to catch problems as
soon as they occur. If you want, you could replace SCHK(s) macro with one
to check a debug-flag and execute the check dependent on that, but it
would still add some non-trivial work to the core, so I propose using this
patch as is.
kaffe-donwulff-hashmap.patch
It was previously agreed that we do not want to go the way of
invidual optimization-touches like this. However due to the whole point of
hash-tables being that they're expected to be fast, and because our
application (XML/XSL processing) uses them so heavily this change alone
makes arguable difference, I'm posting this patch here to at least make it
available to people with similiar interests. As the comment says, it folds
in two very small convenience methods into the HashMap.find(Object) call,
which is crucial method for most hashtable operations.
kaffe-donwulff-vertypo.patch
No doubt a very important patch with far-ranging consequences ;)
-Jukka Santala
---559023410-1804928587-1031828785=:26878
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="kaffe-donwulff-vertypo.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.44.0209121406250.26878@morphine.tml.hut.fi>
Content-Description:
Content-Disposition: attachment; filename="kaffe-donwulff-vertypo.patch"
SW5kZXg6IGthZmZlL2thZmZlL3ZlcnNpb24uYw0KPT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PQ0KUkNTIGZpbGU6IC9jdnMva2FmZmUva2FmZmUva2FmZmUva2Fm
ZmUvd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; charset=US-ASCII; name="kaffe-donwulff-sanitychk.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.44.0209121406251.26878@morphine.tml.hut.fi>
Content-Description:
Content-Disposition: attachment; filename="kaffe-donwulff-sanitychk.patch"
SW5kZXg6IGthZmZlL2thZmZldm0vaml0My9tYWNoaW5lLmMNCj09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT0NClJDUyBmaWxlOiAvY3ZzL2thZmZlL2thZmZlL2th
ZmZlL2thZmZldm0vaml0My9tYWNoaW5lLmMsdg0KcmV0cmlldmluZyByZXZp
c2lvbiAxLjI4DQpkaWZmIC11IC1yMS4yOCBtYWNoaW5lLmMNCi0tLSBrYWZm
ZS9rYWZmZXZtL2ppdDMvbWFjaGluZS5jCTIwIEp1biAyMDAxIDIyOjUwOjAx
IC0wMDAwCTEuMjgNCisrKyBrYWZmZS9rYWZmZXZtL2ppdDMvbWFjaGluZS5j
CTEyIFNlcCAyMDAyIDEwOjUwOjE4IC0wMDAwDQpAQCAtMTIsNyArMTIsNyBA
QA0KICAqIG9mIHRoaXMgZmlsZS4NCiAgKi8NCiANCi0jZGVmaW5lIFNDSEso
cykgcw0KKyNkZWZpbmUgU0NISyhzKQ0KICNkZWZpbmUJU1VTRShzKQ0KIA0K
ICNpbmNsdWRlICJjb25maWcuaCINCkluZGV4OiBrYWZmZS9rYWZmZXZtL2pp
dDMvcmVnaXN0ZXJzLmMNCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NClJDUyBm
aWxlOiAvY3ZzL2thZmZlL2thZmZlL2thZmZlL2thZmZldm0vaml0My9yZWdp
c3RlcnMuYyx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEuOQ0KZGlmZiAtdSAt
cjEuOSByZWdpc3RlcnMuYw0KLS0tIGthZmZlL2thZmZldm0vaml0My9yZWd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KzQ5OSw3IEBADQogaW50DQogc2xvdE9mZnNldChTbG90RGF0YSogc2xv
dCwgaW50IHR5cGUsIGludCB1c2UpDQogew0KLQlzYW5pdHlDaGVjaygpOw0K
K1NDSEsoCXNhbml0eUNoZWNrKCk7CQkJCQkJKQ0KIA0KIAkvKiBJZiBzbG90
IGlzIGluIGEgcmVnaXN0ZXIsIGNsb2JiZXIgdGhlIHJlZ2lzdGVyIHRvIGZv
cmNlIGl0IGJhY2sNCiAJICogaW50byBtZW1vcnkuDQpAQCAtNTA3LDcgKzUw
OSw3IEBADQogCQljbG9iYmVyUmVnaXN0ZXIoc2xvdFsxXS5yZWdubyk7DQog
CX0NCiANCi0Jc2FuaXR5Q2hlY2soKTsNCitTQ0hLKAlzYW5pdHlDaGVjaygp
OwkJCQkJCSkNCiANCiAJcmV0dXJuIChzbG90T2Zmc2V0Tm9TcGlsbChzbG90
LCB0eXBlKSk7DQogfQ0KQEAgLTU0NCw3ICs1NDYsNyBAQA0KIAlTbG90RGF0
YSoqIHB0cjsNCiAJaW50IHJlZzsNCiANCi0Jc2FuaXR5Q2hlY2soKTsNCitT
Q0hLKAlzYW5pdHlDaGVjaygpOwkJCQkJCSkNCiANCiAJcmVnID0gc2RhdGEt
PnJlZ25vOw0KIA0KQEAgLTU3MSw3ICs1NzMsNyBAQA0KIAl9DQogCXNkYXRh
LT5tb2RpZmllZCA9IDA7DQogDQotCXNhbml0eUNoZWNrKCk7DQorU0NISygJ
c2FuaXR5Q2hlY2soKTsJCQkJCQkpDQogfQ0KIA0KIC8qDQo=
---559023410-1804928587-1031828785=:26878
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="kaffe-donwulff-hashmap.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.44.0209121406252.26878@morphine.tml.hut.fi>
Content-Description:
Content-Disposition: attachment; filename="kaffe-donwulff-hashmap.patch"
SW5kZXg6IGxpYnJhcmllcy9qYXZhbGliL2phdmEvdXRpbC9IYXNoTWFwLm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