이 경우 프로파일 러를 사용할 수 있습니다. UI 요구 사항을 다시 작성하고 도구 -> 시간 프로파일 러에서 실행하려고했습니다. 이것은 코드입니다 : 당신이 그 부분을 속도를 시도 할 수 있도록 스크린 샷에서 볼 수 있듯이
| specArray widgets view layout |
" Configure the Spec models "
specArray := OrderedCollection new: 81 * 2.
1 to: 81 do: [ : index | specArray
add: ('textInput' , index asString) asSymbol;
add: #TextInputFieldModel ].
view := DynamicComposableModel new
instantiateModels: specArray;
extent: [email protected];
title: 'Title'
yourself.
" Configure the Spec layout "
widgets := specArray reject: [ : ti | ti = #TextInputFieldModel ].
layout := SpecLayout composed
newColumn: [ : r |
widgets doWithIndex: [ : ti : index | r add: ti ] ];
yourself.
" Set up the widgets "
widgets doWithIndex: [ : each : index | (view perform: each) text: index asString ].
" Open the Window "
(view openWithSpecLayout: layout) delete.
, 대부분의 시간을 TextInputFieldModel에 소요되는 >> defaultEntryCompletion
(불행히도 방법은 undocummented됩니다) 당신이 레안드로의 제안을 적용하면
당신은에서
- 3902 탈리, 3912 밀리 속도를 높일 수 있습니다.
- 3916 회, 3927 msec.
에
TextInputFieldModel의 코드 >> defaultEntryCompletion은 다음과 같습니다
defaultEntryCompletion
| applicants |
applicants := (Array streamContents: [:strm |
Smalltalk globals keysDo: [ : each | (each notEmpty and: [each first canBeGlobalVarInitial])
ifTrue: [ strm nextPut: each ] ] ]) sort.
^EntryCompletion new
dataSourceBlock: [:currText | applicants];
filterBlock: [:currApplicant :currText | currText size > 3
and: [currApplicant asUppercase includesSubstring: currText asString asUppercase]].
는 플라이급 패턴의 구현 각 | (각 notEmpty 및 : [각 첫 번째 canBeGlobalVarInitial]) ifTrue : [strm nextPut : each]]'. –