[BUG] Showing a large file in File List (.changes for example)

Dan Ingalls DanI at wdi.disney.com
Mon Mar 29 17:43:32 UTC 1999


>Does anyone know why Squeak2.3 has a problem showing large files in a File
>List?
>
>I have no problem loading (3-4 seconds for 3.5 Mb) the .changes file in a
>workspace of Visual Smalltalk but when I try to view the file in File List
>(Squeak) everything comes to a halt.
>
>I haven't looked into it yet, but if anyone knows something...

Reinier -

Here's what I know...

1.  I don't know what VS does, but Squeak makes no effort to window the file -- it fully composes the 100,000 lines or so.  The FileList should probably have a windowing feature for large files.

2.  Squeak is significantly slower (right now) anyway. Ask Ian how Jitter is coming along ;-).

3.  There is a specific performance bug having to do with edits in the early part of the file that I am working on right now, but I don't think edits were the focus of your problem.

4.  An outrageous performance bug was introduced into RunArray = last fall by generalizing the runs and values from Arrays to OrderedCollections.  I am hoping to revert this change some day (it also made a mess of the storeStrings), but I did release a fix for this worst problem on 1/15/99.  If you do not have the code below, it should improve the problem a great deal.

5.  Finally, the default composition box for text included an "infinity" of 99999 pixels as the height of the composition box.  This caused text in large files simply not to be seen as.  On 1/28/99 I updated this with two more 9's.

Both (4) and (5) are in updates, but if you want to get them by themselves, the code below should do the job.  3.5MB will still be slow, but it should at least work.  I just opened an 8.6MB changes file on my Powerbook.  It took almost two minutes, but it worked and I can see everything through the end of the file.

Hope this helps.

	- Dan

'From Squeak 2.3 of January 14, 1999 on 29 March 1999 at 9:22:12 am'!

!SequenceableCollection methodsFor: 'comparing' stamp: 'di 3/29/1999 09:18'!
hasEqualElements: otherCollection 
	"Answer whether the receiver's size is the same as otherCollection's size, and each of the receiver's elements equal the corresponding element of otherCollection.  This should probably replace the current definition of = ."
	| size |
	(size _ self size) = otherCollection size ifFalse: [^ false].
	1 to: size do:
		[:index | (self at: index) = (otherCollection at: index) ifFalse: [^false]].
	^true! !


!RunArray methodsFor: 'accessing' stamp: 'di 3/29/1999 09:18'!
= otherArray
	"Test if all my elements are equal to those of otherArray"

	(otherArray isMemberOf: RunArray) ifFalse: [^ self hasEqualElements: otherArray].

	"Faster test between two RunArrays"
 	^ (runs hasEqualElements: otherArray runs)
		and: [values hasEqualElements: otherArray values]! !


!TextMorph methodsFor: 'geometry' stamp: 'di 3/29/1999 09:20'!
container 
	"Return the container for composing this text.  There are four cases:
	1.  container is specified as, eg, an arbitrary shape,
	2.  container is specified as the bound rectangle, because
		this morph is linked to others,
	3.  container is nil, and wrap is true -- grow downward as necessary,
	4.  container is nil, and wrap is false -- grow in 2D as nexessary."

	container ifNil:
		[successor ifNotNil: [^ self bounds].
		wrapFlag ifTrue: [^ self bounds withHeight: 9999999].
		^ self position extent: 9999999 at 9999999].
	^ container! !





More information about the Squeak-dev mailing list