发明名称 Purity analysis using white list/black list analysis
摘要 Memoizable functions may be identified by analyzing a function's side effects. The side effects may be evaluated using a white list, black list, or other definition. The side effects may also be classified into conditions which may or may not permit memoization. Side effects that may have de minimus or trivial effects may be ignored in some cases where the accuracy of a function may not be significantly affected when the function may be memoized.
申请公布号 US9262416(B2) 申请公布日期 2016.02.16
申请号 US201213671831 申请日期 2012.11.08
申请人 Microsoft Technology Licensing, LLC 发明人 Gounares Alexander G.;Li Ying;Garrett Charles D.;Noakes Michael D.
分类号 G06F17/30;G06F7/00 主分类号 G06F17/30
代理机构 代理人 Tabor Ben;Chinagudabha Raghu;Minhas Micky
主权项 1. A computer-implemented method of performing an optimization technique of memoization wherein a program's performance is improved by caching results of one or more function calls so that when the program is executing, the cached results may be returned for the one or more function calls without having to re-execute them, the computer-implemented method being performed by at least one processor executing computer executable instructions for the computer-implemented method, and the computer-implemented method comprising: performing a static code analysis of the program which identifies for one or more functions of the program whether a function has a side effect, and if not, classifying the function as pure, and if the function has a side effect, classifying the function as impure; for each function classified as pure, determining whether the pure function is associated with a computational cost that meets or exceeds a selected threshold value that represents a minimum computation cost or overhead by which optimization would be improved by memoization of the pure function, and if the pure function meets or exceeds the threshold value, adding the pure function to a memoization list; for each function classified as impure, executing the impure function in an instrumented execution environment with a load generator in order to perform a further analysis to determine if the impure function meets additional criteria which comprises: determining whether the impure function is associated with a computational cost that meets or exceeds the selected threshold value, and if not skipping the impure function;evaluating whether the impure function behaves consistently and predictably while executing under a load imposed by the load generator, and if not skipping the impure function; andlooking up at least one side effect of the impure function in a database used to classify side effects on either a white list representing side effect known to be innocuous or de minimus or a black list representing side effects for which memoization is improper, and if the at least one side effect is on the black list, skipping the impure function; if the additional criteria is met, adding the impure function to the memoization list and storing the memoization list in a configuration database to facilitate retrieval of cached results of the impure function added to the memoization list; and subsequently using the stored memoization list to facilitate return of the cached results for one or more functions stored on the memoization list so that the cached results are provided without having to re-execute the one or more functions.
地址 Redmond WA US
您可能感兴趣的专利