I am studying performance analysis and character instance gets brought up a lot. I am unclear to what this means. It also talks about functions of instance characteristics. Can someone elaborate?

4 Years
Discussion Span
Last Post by vijayan121

Let us say we have a function:

// return a string with all occurrences of substr in str replaced with replacement  
std::string replace_all( const std::string& str, const std::string& substr, 
                         const std::string& replacement ) ;

This function can be called with many different input sets (each set being a tuple of three strings). A specific invocation of the function with a given input set is an instance. To analyuse its time and space complexity, we need to consider what happens as the size of data increases - what are the characteristics of the input data set which will affect performance? An instance characteristic is a (typically numeric) measure of the proiperties of the input data that has a bearing on performance.

In the above example, the instance characteristics would be
N - the length of str
K - the length of substr
L - the length of replacement

We would aim to estimate performance of the function as time(N,K,L) or space(N,K,L)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.