arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1810.09555cs.PL
收藏

ShareJIT:跨进程的JIT代码缓存共享及其实现

ShareJIT: JIT Code Cache Sharing across Processes and Its Practical Implementation

Xiaoran Xu, Keith Cooper, Jacob Brock, Yan Zhang, Handong Ye

摘要:

在动态规划语言实现中,结合代码缓存的即时(JIT)编译被广泛用于提高性能。但是,这些代码缓存以及热代码的相关分析数据会消耗大量内存。此外,它们的创建需要额外的JIT编译时间。在Android上,当前的标准JIT编译器及其代码缓存在进程之间不共享-也就是说,运行时系统为每个运行时进程维护一个私有代码缓存及其相关数据。但是,在同一平台上运行的应用程序往往会共享多个公共库。跨多个应用程序和多个进程共享缓存的代码可以减少内存使用。它可以直接减少编译时间。它还可以减少解释代码所花费的累积时间。所有这三种效果都可以提高实际的运行时性能。在本文中,我们描述了ShareJIT,这是一个用于JIT的全局代码缓存,可以跨多个应用程序和多个进程共享代码。我们在Android运行时(ART)的背景下实现了ShareJIT,Android运行时(ART)是一种广泛使用的最先进系统。为了增加共享,我们的实现限制了JIT编译器可以用来优化代码的上下文数量。这暴露了一个基本的折衷:增加对单个进程上下文的专门化会降低编译代码可以共享的程度。在ShareJIT中,我们限制了一些优化来增加可共享性。为了评估ShareJIT,我们在总共30个实验中测试了8个流行的Android应用程序。ShareJIT将整体性能平均提高了9%,同时将内存消耗平均降低了16%,JIT编译时间平均降低了37%。

英文摘要:

Just-in-time (JIT) compilation coupled with code caching are widely used to improve performance in dynamic programming language implementations. These code caches, along with the associated profiling data for the hot code, however, consume significant amounts of memory. Furthermore, they incur extra JIT compilation time for their creation. On Android, the current standard JIT compiler and its code caches are not shared among processes---that is, the runtime system maintains a private code cache, and its associated data, for each runtime process. However, applications running on the same platform tend to share multiple libraries in common. Sharing cached code across multiple applications and multiple processes can lead to a reduction in memory use. It can directly reduce compile time. It can also reduce the cumulative amount of time spent interpreting code. All three of these effects can improve actual runtime performance. In this paper, we describe ShareJIT, a global code cache for JITs that can share code across multiple applications and multiple processes. We implemented ShareJIT in the context of the Android Runtime (ART), a widely used, state-of-the-art system. To increase sharing, our implementation constrains the amount of context that the JIT compiler can use to optimize the code. This exposes a fundamental tradeoff: increased specialization to a single process' context decreases the extent to which the compiled code can be shared. In ShareJIT, we limit some optimization to increase shareability. To evaluate the ShareJIT, we tested 8 popular Android apps in a total of 30 experiments. ShareJIT improved overall performance by 9% on average, while decreasing memory consumption by 16% on average and JIT compilation time by 37% on average.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑