🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3719

Re: Type Systems and Dynamic Binding

#3719
From: Douglas E. Quale
Date: Wed, 01 May 1991 12:03
30 lines
2107 bytes
eliot@cs.qmw.ac.uk (Eliot Miranda) writes:
> In article <1991Apr19.132239.9252@daffy.cs.wisc.edu> quale@saavik.cs.wisc.edu
> >     A compiler for a dynamically typed language can dedicate a register to
> >     hold a bitmask that will speed type tag operations.  A C program would
> >     either use an immediate value or a global variable, either of which is
> >     slower and bulkier on many architectures.
>
> I have tried this in my Smalltalk VM. On both 68020 & SPARC there is no
> significant difference in performance attributable to dedicating a register
> to tag detection. Add a register here loose it there.
>

Experience in lisp implementation shows that it is often a good tradeoff to
dedicate one or two registers to tag masks.  Another trick is to have a
register pointing to a vector in memory that holds commonly used constants
and subroutines so that they can be accessed by a short immediate offset
register indirect mode.

The best papers in tagging issues for lisp are a couple by Hennessy.
One of the most interesting results is that even for lisp, the percentage of
execution time spent by ALL tag operations -- tag checking, extraction and
addition -- is much smaller than I would have thought.  I think it is a common
perception that static typing is always an order of magnitude faster than
dynamic binding, but this is not the case.

Analysis of Smalltalk implementation issues might give different results, of
course, and I am not familiar with the Smalltalk literature.

-- Doug Quale
quale@saavik.cs.wisc.edu
Technical Details
Message-ID: <1991May1.120334.26685@daffy.cs.wisc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!uwm.edu!uwvax!daffy!saavik.cs.wisc.edu!quale
References: <3618@sequent.cs.qmw.ac.uk> <7w4813w164w@mantis.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!uwm.edu!uwvax!daffy!saavik.cs.wisc.edu!quale
From: quale@saavik.cs.wisc.edu (Douglas E. Quale)
Newsgroups: comp.lang.misc,comp.object
Subject: Re: Type Systems and Dynamic Binding
Message-ID: <1991May1.120334.26685@daffy.cs.wisc.edu>
Date: 1 May 91 12:03:34 GMT
References: <3618@sequent.cs.qmw.ac.uk> <7w4813w164w@mantis.co.uk>
Sender: news@daffy.cs.wisc.edu (The News)
Organization: University of Wisconsin -- Madison
Lines: 30