Input vector analysis for memoization estimation
First Claim
Patent Images
1. A computer-implemented method comprising:
- selecting a first impure function;
determining an input space for said first impure function, said input space comprising a range of input values for input parameters for said first impure function;
tracing said first impure function during execution and capturing operational data comprising input values and returned results;
determining a first subset of said input space where said first impure function behaves as a pure function;
receiving a new input vector, said new input vector comprising at least one input value not comprised in said operational data;
determining that said new input vector is within said first subset of said input space; and
memoizing said first impure function for said new input vector;
determining a second subset of said input space where said first impure function behaves as an impure function;
receiving a second new input vector, said second input vector comprising input values not found in said operational data;
determining that said second new input vector is within said second subset of said input space; and
not memoizing said first impure function for said second new input vector.
2 Assignments
0 Petitions
Accused Products
Abstract
A function'"'"'s purity may be estimated by comparing a new input vector to previously analyzed input vectors. When a new input vector is within a confidence boundary, the new input vector may be treated as a known vector, even when that vector has not been evaluated. The input vector may reflect the input parameters passed to a function, and the function may be analyzed to determine whether to memoize with the input vector. The function may be a function that behaves as a pure function in some circumstances and with some input vectors, but not with others. By memoizing the function when possible, the function may be executed much faster, thereby improving performance.
130 Citations
13 Claims
-
1. A computer-implemented method comprising:
-
selecting a first impure function; determining an input space for said first impure function, said input space comprising a range of input values for input parameters for said first impure function; tracing said first impure function during execution and capturing operational data comprising input values and returned results; determining a first subset of said input space where said first impure function behaves as a pure function; receiving a new input vector, said new input vector comprising at least one input value not comprised in said operational data; determining that said new input vector is within said first subset of said input space; and memoizing said first impure function for said new input vector; determining a second subset of said input space where said first impure function behaves as an impure function; receiving a second new input vector, said second input vector comprising input values not found in said operational data; determining that said second new input vector is within said second subset of said input space; and not memoizing said first impure function for said second new input vector. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer-implemented method comprising:
-
receiving a first function; performing a static code analysis on said first function and determining that said first function is impure due to a side effect; exercising said first function with a plurality of input vectors, each of said input vectors comprising a set of input parameters; classifying each of said input vectors as either memoizable or not memoizable; mapping said input vectors in a vector space; generating confidence boundaries defining memoizable and not memoizable input vectors, said confidence boundaries defining a subspace within said vector space; receiving a new input vector; determining that said new input vector is within a memoizable subspace; and causing said first function to be memoized with said new input vector;
receiving a second new input vector;determining that said second new input vector is within a non-memoizable subspace; and causing said first function not to be memoized with said second new input vector. - View Dependent Claims (7, 8, 9, 10, 11, 12)
-
-
13. A system comprising:
-
a processor; a purity analyzer executing on said processor, said purity analyzer that; selects a first impure function; determines an input space for said first impure function, said input space comprising a range of input values for input parameters for said first impure function; traces said first impure function during execution and capturing operational data comprising input values and returned results; determines a first subset of said input space where said first impure function behaves as a pure function; receives a new input vector, said new input vector comprising at least one input value not comprised in said operational data; determines that said new input vector is within said first subset of said input space; and memoizes said first impure function for said new input vector; determines a second subset of said input space where said first impure function behaves as an impure function; receives a second new input vector, said second input vector comprising input values not found in said operational data; determines that said second new input vector is within said second subset of said input space; and not memoizes said first impure function for said second new input vector.
-
Specification