[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Time to optimize :operation-handled-p and :send-if-handles [2]



I investigated :OPERATION-HANDLED-P (OHP) and :SEND-IF-HANDLES (SIH) a
bit further and discovered that a LISPM spends a fair portion of its
life inside them, and by optimizing these methods you can make dynamic
windows and the LISPM overall seem to run a bit faster.  Here's what i
learned:

1.  First i monitored OHP and produced a histogram of how often OHP was
called on a particular operation.  Here is a typical example collected
over at least a half hour:

:MOUSE-MOTION-PENDING 291472
:SET-HIGHLIGHTED-PRESENTATION 4849
:READ 4315
:UPDATE-HIGHLIGHTED-PRESENTATION 2739
:REPRESENT-PRESENTATION 1346
:DISPLAYED-STRINGS 1989
:ZWEI-WINDOW 946
:OFFSETS 874
DW::ACCEPT-1 324

The histograms typically have about 50 operations in them.

2.  I then did the same thing for SIH.  Here is an example for only 60
seconds on a machine loading a system:

:SCREEN 4633
:IO-BUFFER 3622
:PROCEED 24

Although SIH is faster than OHP it does a WITHOUT-INTERRUPTS.

3.  Obviously, SIH is being called a huge number of times per minute,
presumably by the window system.

4.  I poked around and noticed that DW:DYNAMIC-MOUSE-WINDOW did both
an SIH and and OHP of some of the methods in the above histograms.  So
i timed it.  On my 3640 a single call takes 7.85e-3 sec, and it is
called between around 10 times a second (median of 3.37 4.44 9.88
51.98 57.5 calls/sec) so something on the order of 7% of every second
is spend inside DY:DYNAMIC-MOUSE-WINDOW.

5.  Luckily, by writing a couple of methods you can make
DYNAMIC-MOUSE-WINDOW 60 times faster.

6.  I think we should take a serious look at such performance issues.
Who knows were we'll find some improvements?