Given graphs G and H, an H-decomposition of G is a partition of the edge set of G such that each part is either a single edge or forms a graph isomorphic to H. Let ϕH(n) be the smallest number ϕ such that any graph G of order n admits an H-decomposition with at most ϕ parts.Here we determine the asymptotic of ϕH(n) for any fixed graph H as n tends to infinity.The exact computation of ϕH(n) for an arbitrary H is still an open problem. Bollobás [B. Bollobás, On complete subgraphs of different orders, Math. Proc. Cambridge Philos. Soc. 79 (1976) 19-24] accomplished this task for cliques. When H is bipartite, we determine ϕH(n) with a constant additive error and provide an algorithm returning the exact value with running time polynomial in logn.