1. A method, in a data processing system, for optimizing code to be run in a heterogeneous data processing environment, comprising: generating a call graph for program code; identifying characteristics of procedures in the call graph, wherein identifying the characteristics of the procedures in the call graph further comprises, for each procedure in the procedures: identifying functions performed as part of the procedure; and identifying at least one of a type service or another function called by the procedure; comparing the characteristics of the procedures to characteristics of processing units in the heterogeneous data processing environment, wherein comparing characteristics of the procedures to characteristics of processing units in the heterogeneous data processing environment comprises: identifying, for each characteristic of a procedure, a comparison rule for that characteristic, wherein the comparison rule identifies a characteristic of a processing unit that may offer a required feature for satisfying the characteristic of the procedure and wherein the comparison rule is established in a program partition engine; determining a degree of matching of each processing unit of the heterogeneous data processing environment to the characteristics of the procedure; and selecting a processing unit based on the degree of matching of each processing unit of the heterogeneous data processing environment; selecting, for each of the procedures, a processing unit to execute the procedure based on results of the comparison by evaluating negative characteristics of the processing units, including latency, to generate a decision as to which processing units are to be used to execute a corresponding procedure; annotating the call graph based on the selected processing unit to process each procedure, functions, type service, or another function called by the procedure; partitioning the program code in accordance with the selection of the processing unit for each procedure based on the annotations in the annotated call graph; and generating executable program code based on the partitioned program code.