Write a Blog >>
ICFP 2019
Sun 18 - Fri 23 August 2019 Berlin, Germany
Fri 23 Aug 2019 11:16 - 11:40 at Elk - Metadata Chair(s): Ningning Xie

GHC utilizes tagged pointers to efficiently encode information about evaluated objects, , like a constructor’s tag or a function’s arity.

In general checking for the presence of a tag is redundant for evaluated objects, as these are usually represented by a tagged pointer. This is especially true for strict fields of constructors which can only contain pointers to evaluated objects.

However, some rare edge cases in GHC prevent guaranteeing the presence of tags for known evaluated objects, both in strict fields and otherwise. This necessitates a check for the tag at runtime; reentering an object’s closure to obtain a tag if none is present.

This is semantically safe, but negatively impacts performance. In this talk, we explain what these edge cases are, how to eliminate them and the consequences of doing so.

Early experiments reveal that changing this can have a surprisingly large performance impact; especially when strict fields are involved. Our branch (WIP) of GHC already demonstrates a speedup of 4% for the benchmark suite of the containers package overall. With many lookup/membership operations showing a speedup of 10-20%.

We will also discuss issues which cause a naive implementation to cause significant performance regressions under specific circumstances, and how these issues can be addressed using an analysis to infer ‘taggedness’ of pointers at compile time. Such an analysis has the added benefit that it allows us to infer ‘taggedness’ in certain cases even for non-strict code, further improving performance. For this purpose, we present our ‘taggedness’ analysis which is based on the STG representation of programs.

As this is work in progress we also hope for a discussion and feedback on our approach.

Fri 23 Aug

Displayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change

10:30 - 12:00
MetadataHIW at Elk
Chair(s): Ningning Xie University of Toronto
10:30
23m
Talk
Configuration, but without CPP
HIW
Matthew Pickering University of Bristol, John Ericson Obsidian Systems
10:53
23m
Talk
HIE files in GHC 8.8
HIW
Zubin Duggal , Matthew Pickering University of Bristol
11:16
24m
Talk
Tagging Tags: Inferring the presence of pointer tags at compile time.
HIW
11:40
20m
Talk
Lightning talks Slot #1
HIW