Number: 1784

Date:  9-Aug-84 17':03':03

Submitter: Sannella.PA

Source: masinter.pa

Subject: GETTOPVAL 50% faster

Assigned To: 

Attn: 

Status: Closed

In/By: 

Problem Type: Performance

Impact: 

Difficulty: 

Frequency: 

Priority: Perhaps

System: Language Support

Subsystem: Storage Formats/Mgt

Machine: 

Disk: 

Lisp Version: 

Source Files: 

Microcode Version: 

Memory Size: 

File Server: 

Server Software Version: 

Disposition: '
["Sannella" "20-Aug-84 18':35':09" Status':(Fixed->Closed)]

Description: '
Date':  9 Jul 84 19':04 PDT'
From': masinter.pa'
Subject': GETTOPVAL 50% faster'
To': lispsupport'
cc': jonl, kaplan'
'
I made GETTOPVAL and friends 50% faster by changing the explicit (COND ((LITATOM --))) check to be a \DTEST and also changing '
the open coded \ADDBASE2 to be an'
(\ADDBASE base (UNFOLD cell WORDSPERCELL))'
'
The latter would be slower for litatoms > 2↑15 once we had such, but still possibly tolerable. '
'
I thought it *was* written that way once, and wonder who changed it to make it slower.'
'
(User complained that GETTOPVAL took a lot of time in his code according to stats.)'
'
-----'
'
Date': 10 Jul 84 19':30 PDT'
From': JonL.pa'
Subject': ??? GETTOPVAL 50% faster ???'
In-reply-to': masinter.pa''s message of 10 Jul 84 12':41 PDT'
To': masinter.pa'
cc': JonL.pa, lispsupport.pa, kaplan.pa, vanMelle.pa'
Format': TEdit'
'
23←(TIMEALL (GETTOPVAL (QUOTE FOO))'
	 10000)'
(TIMEDUMMYFUNCTION NIL)'
(TIMEDUMMYFUNCTION redefined)'
Elapsed Time =       .179 seconds'
CPU Time =           .179 seconds'
NOBIND'
24←(TIMEALL (NEWGETTOPVAL (QUOTE FOO))'
	 10000)'
(TIMEDUMMYFUNCTION NIL)'
(TIMEDUMMYFUNCTION redefined)'
Elapsed Time =       .142 seconds'
CPU Time =           .142 seconds'
NOBIND'
25←(DIFFERENCE 179 142)'
37'
26←(QUOTIENT 37. 142)'
.2605634'
27←DRIBBLE(NIL)'
'
--- or is it 26% ?'
'
Could you identify the luser who thought that GETTOPVAL was slowing him down?  It would be instructive to know what kind of program it is that calls GETTOPVAL at more than the 1% rate.'
'
The real question is':  why are you taking this backwards step on the LITATOM record definition?  I thought Ron''s comments were the satisfactory answer -- \ADDBASE2 should be an opcode -- and that way there won''t be any kludge code lying around when we go to 64K litatoms.'
'
Incidentally, Bill''s initials are the last ones I see on GETTOPVAL, so that''s why I''m cc''ing him.'
'
-- JonL --'


Workaround: 

Test Case: 

Edit-By: Sannella

Edit-Date: 20-Aug-84 18':35':09