The jet composition and radiative efficiency of GRBs are poorly constrained from the data. If the jet composition is matter-dominated (i.e. a fireball), the GRB prompt emission spectra would include a dominant thermal component originating from the fireball photosphere, and a non-thermal component presumably originating from internal shocks whose radii are greater than the photosphere radius. We propose a method to directly dissect the GRB fireball energy budget into three components and measure their values by combining the prompt emission and early afterglow data. The measured parameters include the initial dimensionless specific enthalpy density ($eta$), bulk Lorentz factors at the photosphere radius ($Gamma_{rm ph}$) and before fireball deceleration ($Gamma_0$), the amount of mass loading ($M$), as well as the GRB radiative efficiency ($eta_gamma$). All the parameters can be derived from the data for a GRB with a dominant thermal spectral component, a deceleration bump feature in the early afterglow lightcurve, and a measured redshift. The results only weakly depend on the density $n$ of the interstellar medium when the composition ${cal Y}$ parameter (typically unity) is specified.