De : moose-dev-bounces@iam.unibe.ch [mailto:moose-dev-bounces@iam.unibe.ch] De la part de Stephan Eggermont
Envoyé : samedi 13 juin 2015 00:09
À : moose-dev@iam.unibe.ch
Objet : [Moose-dev] Re: inspector lag on pharo 5.1
On 12/06/15 23:40, Vincent BLONDEAU wrote:
There is a lag which is due to the printing of the MooseGroupRuntimeStorage items.
In Collection>>gtDisplayOn:, the stream in argument is not used to print the contents of the collection. So the whole collection is printed whereas only a part of the contents has to be printed.
The current implementation is:
“s nextPutAll: ((String streamContents: [ :stream | self printElementsOn: stream ]) truncateWithElipsisTo: 42).”
And it should simply be:
“self printElementsOn: s”
Isn't it faster to use streamContents:limitedTo:45, and then replace the last three characters by dots
without copying the string if the string size is 45?
In fact, streamContents:limitedTo: is already called just before gtDisplayOn:. So the stream given to this method is already limited (not to 45 but 1000).
Vincent
Stephan