Notes |
(0012533 - 88 - 120 - 120 - 120 - 120 - 120)
Keith_Hodges
08-27-08 21:44
|
"fix begin"
Installer mantis bug: 7166 fix: 'Speedup-AllSelectors-M7166.cs'.
"fix end" |
| |
(0012702 - 141 - 141 - 141 - 141 - 141 - 141)
Damien Cassou
09-28-08 14:01
|
I've sent that fix to PharoInbox. I replaced 'withAllSuperclasses do:' by 'withAllSuperclassDo:' to avoid the creation of another collection. |
| |
(0012703 - 283 - 343 - 343 - 343 - 343 - 343)
Damien Cassou
09-28-08 14:47
|
I also added the following test:
testAllSelectors
self assert: ProtoObject allSelectors = ProtoObject selectors.
self assert: Object allSelectors = (Object selectors union: ProtoObject selectors).
self assert: (Object allSelectorsBelow: ProtoObject) = (Object selectors). |
| |
(0012704 - 90 - 122 - 122 - 122 - 122 - 122)
Damien Cassou
09-28-08 16:26
|
"fix begin"
Installer mantis bug: 7166 fix: 'Speedup-AllSelectors-M7166.1.cs'.
"fix end" |
| |
(0013414 - 603 - 876 - 876 - 876 - 876 - 876)
nicolas cellier
11-29-09 20:27
|
In trunk, this doesn't make much difference as long as selectors are Array.
This version is even slightly faster than allSelectorsBelow:
Behavior>>allSelectors
"Answer all selectors understood by instances of the receiver"
^(Array streamContents: [:strm |
self withAllSuperclassesDo:
[:aClass | strm nextPutAll: aClass selectors]]) asIdentitySet
{
[EToyProjectQueryMorph allSelectors] bench.
[EToyProjectQueryMorph allSelectorsBelow: nil] bench.
}
#('59.4691678307723 per second.' '53.64978061428 per second.')
Yes, we create intermediary collections, but cheap ones: Array... |
| |
(0013420 - 307 - 624 - 624 - 624 - 624 - 624)
leves
12-02-09 20:02
|
Even better without the intermediate collections:
Behavior >> allSelectors
"Answer all selectors understood by instances of the receiver"
^(Array streamContents: [ :stream |
self withAllSuperclassesDo: [ :aClass |
aClass selectorsDo: [ :each |
stream nextPut: each ] ] ]) asIdentitySet |
| |
(0013424 - 37 - 37 - 37 - 37 - 37 - 37)
leves
12-03-09 04:24
|
Added to the trunk with Kernel-ul.319 |
| |