Enabling Optimizations Through Demodularization

Programmers want to write modular programs to increase maintainability and create abstractions, but modularity hampers optimizations, especially when modules are compiled separately or written in different languages. In languages with syntactic extension capabilities, each module in a program can be...

Full description

Bibliographic Details
Main Author: Johnson, Blake Dennis
Format: Others
Published: BYU ScholarsArchive 2016
Subjects:
Online Access:https://scholarsarchive.byu.edu/etd/5722
https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=6721&context=etd
id ndltd-BGMYU2-oai-scholarsarchive.byu.edu-etd-6721
record_format oai_dc
spelling ndltd-BGMYU2-oai-scholarsarchive.byu.edu-etd-67212019-05-16T03:03:39Z Enabling Optimizations Through Demodularization Johnson, Blake Dennis Programmers want to write modular programs to increase maintainability and create abstractions, but modularity hampers optimizations, especially when modules are compiled separately or written in different languages. In languages with syntactic extension capabilities, each module in a program can be written in a separate language, and the module system must ensure that the modules interoperate correctly. In Racket, the module system ensures this by separating module code into phases for runtime and compile-time and allowing phased imports and exports inside modules. We present an algorithm, called demodularization, that combines all executable code from a phased modular program into a single module that can then be optimized as a whole program. The demodularized programs have the same behavior as their modular counterparts but are easier to optimize. We show that programs maintain their meaning through an operational semantics of the demodularization process and verify that performance increases by comparing modular Racket programs to the equivalent demodularized and optimized programs. We use the existing Racket optimizer to optimize the demodularized programs by decompiling them into an intermediate form that the optimizer uses. We also demonstrate a dead code elimination optimization that dramatically reduces the file size of demodularized Racket programs. 2016-03-01T08:00:00Z text application/pdf https://scholarsarchive.byu.edu/etd/5722 https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=6721&context=etd http://lib.byu.edu/about/copyright/ All Theses and Dissertations BYU ScholarsArchive macros Racket modules optimization Computer Sciences
collection NDLTD
format Others
sources NDLTD
topic macros
Racket
modules
optimization
Computer Sciences
spellingShingle macros
Racket
modules
optimization
Computer Sciences
Johnson, Blake Dennis
Enabling Optimizations Through Demodularization
description Programmers want to write modular programs to increase maintainability and create abstractions, but modularity hampers optimizations, especially when modules are compiled separately or written in different languages. In languages with syntactic extension capabilities, each module in a program can be written in a separate language, and the module system must ensure that the modules interoperate correctly. In Racket, the module system ensures this by separating module code into phases for runtime and compile-time and allowing phased imports and exports inside modules. We present an algorithm, called demodularization, that combines all executable code from a phased modular program into a single module that can then be optimized as a whole program. The demodularized programs have the same behavior as their modular counterparts but are easier to optimize. We show that programs maintain their meaning through an operational semantics of the demodularization process and verify that performance increases by comparing modular Racket programs to the equivalent demodularized and optimized programs. We use the existing Racket optimizer to optimize the demodularized programs by decompiling them into an intermediate form that the optimizer uses. We also demonstrate a dead code elimination optimization that dramatically reduces the file size of demodularized Racket programs.
author Johnson, Blake Dennis
author_facet Johnson, Blake Dennis
author_sort Johnson, Blake Dennis
title Enabling Optimizations Through Demodularization
title_short Enabling Optimizations Through Demodularization
title_full Enabling Optimizations Through Demodularization
title_fullStr Enabling Optimizations Through Demodularization
title_full_unstemmed Enabling Optimizations Through Demodularization
title_sort enabling optimizations through demodularization
publisher BYU ScholarsArchive
publishDate 2016
url https://scholarsarchive.byu.edu/etd/5722
https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=6721&context=etd
work_keys_str_mv AT johnsonblakedennis enablingoptimizationsthroughdemodularization
_version_ 1719184070631489536