Java 程序特化 - 它是什么?我不明白

标签 java performance scalability

我正在阅读有关程序特化的内容 - 特别是 java,说实话,我认为我不太理解它。到目前为止我的理解是它是一种通过约束参数或输入来优化程序效率的方法?实际上是如何做到的?有人可以向我解释一下它有什么帮助,或者举例说明它实际上做了什么以及如何完成?

谢谢

我一直在阅读:

Program Specialization - java

最佳答案

程序专门化是当您提前知道您将拥有的参数是什么时专门化程序的过程。

一个例子是,如果您有一个测试,并且您知道根据您的参数,您永远不会进入该 block ,那么您可以消除该测试。

您为某种输入创建了程序的专用版本。

基本上,它有助于摆脱你输入的无用内容。然而,使用现代架构和编译器(至少在 C 语言中),您不会在性能方面获得太多优势。

来自同一作者,我会推荐 Tempo 作品。

编辑

来自 Toplas 论文:

Program specialization is a program transformation technique that optimizes a pro- gram fragment with respect to information about a context in which it is used, by generating an implementation dedicated to this usage context. One approach to automatic program specialization is partial evaluation, which performs aggressive inter-procedural constant propagation of values of all data types, and performs constant folding and control-flow simplifications based on this information [Jones et al. 1993]. Partial evaluation thus adapts a program to known (static) informa- tion about its execution context, as supplied by the user (the programmer). Only the program parts controlled by unknown (dynamic) data are reconstructed. Par- tial evaluation has been extensively investigated for functional languages [Bondorf 1990; Consel 1993], logic languages [Lloyd and Shepherdson 1991], and imperative languages [Andersen 1994; Baier et al. 1994; Consel et al. 1996].

关于Java 程序特化 - 它是什么?我不明白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2548128/

相关文章:

java - 通过减去动态配置的时间单位来获取日期的有效方法

java - 我可以在返回 ModelAndView 之前设置 url 吗?

java - 更改局部变量中的字典对象

performance - 如何收集Unity上的Profiler数据?

asp.net-mvc-3 - MVC3 部分 View OutputCache 被父 View 覆盖

node.js - 跨多个核心/服务器扩展 Node.JS

java - 在 Google 搜索栏中写入

c# - 监控和计算 asp.net 网站性能

sql-server - 为什么 UPDATE 比 SELECT 花费的时间长得多?

jakarta-ee - 如何编写可扩展的 java-ee 应用程序