A method and system makes inlining decisions that are efficient for subprograms
that have significantly varying execution times over a range of variables or execution
paths. A subprogram of a computer program is identified and certain execution paths
of the subprogram are selectively inlined. The subprogram may be identified based
on execution characteristics of the subprogram. The selective inlining of the execution
paths may be based on execution characteristics of the paths. The paths may be
selectively inlined based on an inline indication associated with an execution
path, where the inline indication may be an inline directive. The inline directive
may be included as part of a program comment statement. A compiler makes determinations
whether to inline a specific execution path of a subprogram by evaluating certain
information supplied in conjunction with the path. By supplying information in
association with the subprogram path, the compiler may more easily determine the
various execution characteristics of the execution paths and may inline or not
based on the execution characteristic indication associated with the subprogram
execution path.