首页>
外国专利>
Methods of Graph-Type Specialization and Optimization in Graph Algorithm DSL Compilation
Methods of Graph-Type Specialization and Optimization in Graph Algorithm DSL Compilation
展开▼
机译:图算法DSL编译中图类型专业化和优化的方法
展开▼
页面导航
摘要
著录项
相似文献
摘要
Techniques herein generate, such as during compilation, polymorphic dispatch logic (PDL) to switch between specialized implementations of a polymorphic graph algorithm. In an embodiment, a computer detects, within source logic of a graph algorithm, that the algorithm processes an instance of a generic graph type. The computer generates several alternative implementations of the algorithm. Each implementation is specialized to process the graph instance as an instance of a respective graph subtype. The computer generates PDL that performs dynamic dispatch as follows. At runtime, the PDL receives a graph instance of the generic graph type. The PDL detects which particular graph subtype is the graph instance. The PDL then invokes whichever alternative implementation that is specialized to process the graph instance as an instance of the detected particular graph subtype. In embodiments, the source logic is expressed in a domain specific language (DSL), e.g. for analysis, traversal, or querying of graphs.
展开▼