Communication Dans Un Congrès Année : 2018

Strategies for typecase optimization

Résumé

We contrast two approaches to optimizing the Common Lisp typecase macro expansion. The first approach is based on heuristics intended to estimate run time performance of certain type checks involving Common Lisp type specifiers. The technique may, depending on code size, exhaustively search the space of permutations of the type checks, intent on finding the optimal order. With the second technique, we represent a typecase form as a type specifier, encapsulating the side-effecting non-Boolean parts so as to appear compatible with the Common Lisp type algebra operators. The encapsulated expressions are specially handled so that the Common Lisp type algebra functions preserve them, and we can unwrap them after a process of Boolean reduction into efficient Common Lisp code, maintaining the appropriate side effects but eliminating unnecessary type checks. Both approaches allow us to identify un-reachable code, test for exhaustiveness of the clauses and eliminate type checks which are calculated to be redundant.

Fichier principal
Vignette du fichier
newton.18.els.pdf (599.83 Ko) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)
Licence
Loading...

Dates et versions

hal-01770939 , version 1 (23-04-2018)

Licence

Identifiants

  • HAL Id : hal-01770939 , version 1

Citer

Jim E Newton, Didier E Verna. Strategies for typecase optimization. European Lisp Symposium, Apr 2018, Marbella, Spain. ⟨hal-01770939⟩
80 Consultations
315 Téléchargements

Partager

  • More