Real Slowdown of InputSensor between 3.8 and 3.9
Gary Chambers
gazzaguru2 at btinternet.com
Tue May 1 14:41:35 UTC 2007
Changed that is my image some time ago (in EventSensor) for the same
reasons...
shiftPressed
"Answer whether the shift key on the keyboard is being held down."
^mouseButtons anyMask: 8
controlKeyPressed
"Answer whether the control key on the keyboard is being held down."
^mouseButtons anyMask: 16
commandKeyPressed
"Answer whether the command key on the keyboard is being held down."
^mouseButtons anyMask: 64
-----Original Message-----
From: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of Stéphane
Ducasse
Sent: 01 May 2007 2:31 pm
To: The general-purpose Squeak developers list
Subject: Real Slowdown of InputSensor between 3.8 and 3.9
Hi
I was surprised by the slowdown of one of my little applications and
I messageTalliedThem
wtih exactly the same code on 3.8 and 3.9
Here are the results:
MessageTally spyOn: [ | bdb |
BDBase initialize.
BDBase resetBaseNamed: #BD.
bdb := BDBase new name: #BD.
bdb importMostRecentXML.]
On 38
Time millisecondsToRun: [ | bdb |
BDBase initialize.
BDBase resetBaseNamed: #BD.
bdb := BDBase new name: #BD.
bdb importMostRecentXML.] 1677
**Leaves**
3.2% {56ms} MultiByteFileStream>>next
3.2% {56ms} MultiByteFileStream>>doConversion
3.0% {52ms} UTF8TextConverter>>nextFromStream:
3.0% {52ms} SmallInteger(Number)>>negative
2.9% {51ms} MultiByteFileStream(StandardFileStream)>>basicNext
2.9% {51ms} SAXDriver(XMLTokenizer)>>next
2.9% {51ms} MultiByteFileStream>>converter
2.6% {45ms} ByteSymbol class(String class)>>stringHash:initialHash: 2.5%
{44ms} MultiByteFileStream>>wantsLineEndConversion
2.1% {37ms} MultiByteFileStream(StandardFileStream)>>isBinary
on 39
- 21243 tallies, 21304 msec.
**Tree**
100.0% {21304ms} BDBase>>importMostRecentXML
99.8% {21261ms} BDBase>>importXMLFromFileName:
99.8% {21261ms} BDXMLImporter>>importFileNamed:
99.8% {21261ms} BDXMLImporter>>importStream:
96.5% {20558ms} BDXMLImporter>>importXMLDoc:
|89.2% {19003ms} EventSensor(InputSensor)>>shiftPressed
| |89.2% {19003ms} EventSensor>>primMouseButtons
| | 89.2% {19003ms} EventSensor>>wait2ms
| | 89.1% {18982ms} Delay>>wait
| | 89.1% {18982ms} primitives
|7.3% {1555ms} BDXMLImporter>>importBD:
3.3% {703ms} XMLDOMParser class>>parseDocumentFrom:
3.3% {703ms} XMLDOMParser class(SAXHandler class)
>>parseDocumentFrom:
3.3% {703ms} XMLDOMParser(SAXHandler)>>parseDocument
3.3% {703ms} SAXDriver(XMLTokenizer)>>nextEntity
3.2% {682ms} SAXDriver(XMLTokenizer)>>nextNode
3.2% {682ms} SAXDriver(XMLTokenizer)>>nextTag
2.7% {575ms} SAXDriver(XMLTokenizer)
>>nextAttributeInto:namespaces:
**Leaves**
89.1% {18982ms} Delay>>wait
**Memory**
old +4,748,696 bytes
young -3,868,600 bytes
used +880,096 bytes
free +2,512,576 bytes
**GCs**
full 1 totalling 83ms (0.0% uptime), avg 83.0ms
incr 541 totalling 200ms (1.0% uptime), avg 0.0ms
tenures 25 (avg 21 GCs/tenure)
root table 0 overflows
Time millisecondsToRun: [ | bdb |
BDBase initialize.
BDBase resetBaseNamed: #BD.
bdb := BDBase new name: #BD.
bdb importMostRecentXML.] 21182
So it seems that some logic were changed in the inputSensor. When I
commented InputSensor default shiftPressed ifTrue: [self halt.]. in
the import method
importXMLDoc: aXMLDoc
aXMLDoc elements first elements do:
[:each | Transcript show: '.'. "InputSensor default
shiftPressed
ifTrue: [self halt.]."
self importBD: each].
Now my benchmarck give me.
Time millisecondsToRun: [ | bdb |
BDBase initialize.
BDBase resetBaseNamed: #BD.
bdb := BDBase new name: #BD.
bdb importMostRecentXML.] 1643
I thought that it is worth to share.
Stef
More information about the Squeak-dev
mailing list
|