1. A method for optimising compiler-generated program code intended for a portable data carrier having a processor core and a first and second memory area, comprising: the first memory area being provided to receive the optimised program code, the second memory area being provided to receive a predefined library having a multiplicity of library code fragments, wherein the contents of the predefined library have been determined independently from the compiler-generated program code that is to be optimized, and the compiler-generated program code being searched for program code fragments that perform the same function as a respective one of the library code fragments, the program code fragments found thereby being replaced by respectively one call of the corresponding library code fragment.