A method and a non-transitory computer-readable medium having computer program for optimizing a system function-flow of a system capable of performing at least one function and comprising a plurality of components by utilizing application programming interface (API) profiling are provided. The method comprises receiving a request to perform the at least one function of the system from a user; obtaining at least one component required to realize the at least one function requested by the user from the plurality of the components; providing a plurality of APIs to the at least one obtained component to choose from; profiling each of the plurality of APIs to get a performance score of each API; based on the profiled APIs, optimizing the system function-flow of the system; determining corresponding APIs for the optimized system function-flow; and performing the at least one function requested by the user based on the determined APIs.
展开▼