Guard the Cache: Dispatch Optimization in a Contextual Role-oriented Language

Research output: Contribution to book/conference proceedings/anthology/reportConference contributionContributedpeer-review

Contributors

Abstract

Adaptive programming models are increasingly important as context-dependent software conquers more domains. One such a model is role-oriented programming where behavioral changes are implemented by objects playing and renouncing roles. As with other adaptive models, the overhead introduced by source code adaptations is a major showstopper for role-oriented programs. This is in part because the optimizations of object-oriented virtual machines (VMs) do not provide the same performance gains when applied to role-oriented programs. Recently, dispatch plans have been shown to enable optimizations beyond those in VMs, thereby improving the performance of role programs with low variability. This paper introduces guarded dispatch plans, an extension of dispatch plans with a context-aware guarding mechanism that allows reuse in high-variability scenarios. Fine-grained guards use run-time feedback to partially reuse dispatch plans across call sites when contexts are changing. We present an algorithm to construct and compose guarded dispatch plans and provide a reference implementation of the approach. We show that our approach is able to gracefully degrade into a default dispatch approach when variability increases. The implementation is evaluated with synthetic benchmarks capturing different characteristics. Compared to the state-of-the-art implementation in ObjectTeams we achieved a mean speedup of 3.3 × in static cases, 3.0 × at low variability and the same performance in highly dynamic cases.

Details

Original languageEnglish
Title of host publicationCOP 2022 - Proceedings of the 14th International Workshop on Context-Oriented Programming and Advanced Modularity, Co-located with ECOOP 2022
EditorsYudai Tanabe, Jens Lincke, Robert Hirschfeld, Atsushi Igarashi, Hidehiko Masuhara
PublisherAssociation for Computing Machinery
Pages27-34
Number of pages8
ISBN (electronic)9781450399869
Publication statusPublished - 7 Jun 2022
Peer-reviewedYes

Publication series

SeriesACM International Conference Proceeding Series

Conference

Title14th International Workshop on Context-Oriented Programming and Advanced Modularity, COP 2022 - Co-located with ECOOP 2022
Duration7 June 2022
CityBerlin
CountryGermany

External IDs

ORCID /0000-0002-5007-445X/work/160049129

Keywords

Keywords

  • adaptive programming, context, dynamic dispatch, roles