Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.369.mcz
==================== Summary ====================
Name: EToys-nice.369
Author: nice
Time: 17 November 2019, 3:49:19.084237 pm
UUID: 6bc2f1bf-b9c6-45e1-8780-e0a2d826b233
Ancestors: EToys-mt.368
Replace (findTokens: Character separators) with substrings which is both a shorter and faster idiom.
| tmp |
tmp := String allSubInstances.
{
[tmp do: [:e | e substrings]] bench.
[tmp do: [:e | e findTokens: Character separators]] bench.
[tmp do: [:e | e findTokens: CharacterSet separators]] bench.
}.
#(
'1.17 per second. 852 milliseconds per run. 16.22996 % GC time.'
'0.285 per second. 3.51 seconds per run. 5.30746 % GC time.'
'1.18 per second. 849 milliseconds per run. 20.13357 % GC time.')
=============== Diff against EToys-mt.368 ===============
Item was changed:
----- Method: BookMorph>>textSearchAgain (in category '*Etoys-Squeakland-menu') -----
textSearchAgain
"The classic find-again"
| wanted wants list |
list := self valueOfProperty: #searchKey ifAbsent: [#()].
wanted := String streamContents: [:strm |
list do: [:each | strm nextPutAll: each; space]].
+ wants := wanted substrings.
- wants := wanted findTokens: Character separators.
wants isEmpty ifTrue: [^ self].
self getAllText. "save in allText, allTextUrls"
^ self findText: wants "goes to the page and highlights the text"!
Item was changed:
----- Method: CardPlayer>>asKeys (in category 'card data') -----
asKeys
| keys kk vd gotData |
"Take my fields, tokenize the text, and return as an array in the same order as variableDocks. Simple background fields on the top level. If no data, return nil."
keys := self class variableDocks copy.
gotData := false.
1 to: keys size do: [:ind |
kk := nil.
vd := self class variableDocks at: ind.
vd type == #text ifTrue: [
kk := (self perform: vd playerGetSelector) string
+ substrings.
- findTokens: Character separators.
kk isEmpty ifTrue: [kk := nil] ifFalse: [gotData := true]].
keys at: ind put: kk].
^ gotData ifTrue: [keys] ifFalse: [nil]!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.858.mcz
==================== Summary ====================
Name: Collections-nice.858
Author: nice
Time: 17 November 2019, 12:46:04.058035 pm
UUID: cd5d4533-11f2-2340-8957-a577330de15d
Ancestors: Collections-pre.857
Fix union: and intersection: of CharacterSet
We must avoid using naive loops for huge sets that canBeEnumerated not.
An enumerationCost scale is introduced for that purpose.
The idea is that intersection: must be performed by the cheapest set, while union: must be performed by the most expensive. The most expensive eventually knows how to handle loops lazily.
=============== Diff against Collections-pre.857 ===============
Item was added:
+ ----- Method: ByteCharacterSet>>enumerationCost (in category 'private') -----
+ enumerationCost
+ "Low cost. I do not hold more than 256 characters."
+
+ ^10!
Item was removed:
- ----- Method: ByteCharacterSet>>union: (in category 'enumerating') -----
- union: aCollection
- (self isCharacters: aCollection) ifFalse: [^super union: aCollection].
- (self species = aCollection species and: [self class ~= aCollection class]) ifTrue: [^aCollection union: self].
- ^self copy addAll: aCollection; yourself!
Item was changed:
Collection subclass: #CharacterSet
instanceVariableNames: 'byteArrayMap'
classVariableNames: 'Ascii CrLf NonAscii NonSeparators Separators'
poolDictionaries: ''
category: 'Collections-Support'!
+ !CharacterSet commentStamp: 'nice 11/17/2019 12:26' prior: 0!
+ A set of characters. Lookups for inclusion are very fast.
+ CharacterSet is the abstract class that is visible to the outside world.
+ Subclasses should be considered as implementation details.!
- !CharacterSet commentStamp: '<historical>' prior: 0!
- A set of characters. Lookups for inclusion are very fast.!
Item was added:
+ ----- Method: CharacterSet>>as: (in category 'converting') -----
+ as: otherClass
+ otherClass = CharacterSet ifTrue: [^self].
+ ^super as: otherClass!
Item was added:
+ ----- Method: CharacterSet>>enumerationCost (in category 'private') -----
+ enumerationCost
+ "Answer an integer giving a scale of cost, especially for do: loops."
+
+ ^self subclassResponsibility!
Item was added:
+ ----- Method: CharacterSet>>intersection: (in category 'enumerating') -----
+ intersection: aCollection
+ (self species = aCollection species and: [aCollection enumerationCost < self enumerationCost]) ifTrue: [^aCollection intersection: self].
+ ^ self select: [:each | aCollection includes: each]!
Item was added:
+ ----- Method: CharacterSet>>union: (in category 'enumerating') -----
+ union: aCollection
+ (self isCharacters: aCollection) ifFalse: [^super union: aCollection].
+ (self species = aCollection species and: [aCollection enumerationCost > self enumerationCost]) ifTrue: [^aCollection union: self].
+ ^self copy addAll: aCollection; yourself!
Item was added:
+ ----- Method: CharacterSetComplement>>enumerationCost (in category 'private') -----
+ enumerationCost
+ "The maximum cost. I can't even do: loops, it's too expensive."
+
+ ^100!
Item was removed:
- ----- Method: LazyCharacterSet>>complement (in category 'converting') -----
- complement
- ^self class including: [:char | (block value: char) not]!
Item was added:
+ ----- Method: LazyCharacterSet>>enumerationCost (in category 'private') -----
+ enumerationCost
+ "The maximum cost. I can't even do: loops, it's too expensive."
+
+ ^100!
Item was changed:
----- Method: LazyCharacterSet>>intersection: (in category 'enumerating') -----
intersection: aCollection
+ ^((self isCharacters: aCollection)
+ ifTrue: [aCollection select: block]
+ ifFalse:
+ ["protect feeding block with non character"
+ aCollection select: [:e |e isCharacter and: [block value: e]]]) as: CharacterSet
+ !
- (self species = aCollection species or: [aCollection isString or: [aCollection allSatisfy: [:e | e isCharacter]]]) ifFalse: [^super intersection: aCollection].
- ^self class including: [:c | (aCollection includes: c) and: [block value: c]]!
Item was added:
+ ----- Method: WideCharacterSet>>enumerationCost (in category 'private') -----
+ enumerationCost
+ "Medium cost. I can hold many characters eventually."
+
+ ^50!
Item was removed:
- ----- Method: WideCharacterSet>>union: (in category 'enumerating') -----
- union: aCollection
- (self isCharacters: aCollection) ifFalse: [^super union: aCollection].
- (self species = aCollection species and: [self class ~= aCollection class]) ifTrue: [^aCollection union: self].
- ^self copy addAll: aCollection; yourself!
David T. Lewis uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ct.706.mcz
==================== Summary ====================
Name: Monticello-ct.706
Author: ct
Time: 15 November 2019, 7:37:26.401005 pm
UUID: dc41402b-0662-5f4e-b13e-33dde1be1ffe
Ancestors: Monticello-mt.705
Refresh Version Inspector after reparent was pressed.
=============== Diff against Monticello-mt.705 ===============
Item was changed:
----- Method: MCVersionInspector>>reparent (in category 'accessing') -----
reparent
(self confirm:'Adopt ',self version info name, ' as the sole ancestor of your working copy?')
+ ifTrue: [
+ self version reparent.
+ self refresh]!
- ifTrue: [self version reparent]!