The atomic data of middle and high-Z elements, such as electron-impact ionization and excitation cross-sections, find extensive applications in fields such as fusion science and X-ray interactions with matter. There are atoms and ions in high energy density plasma with different charge states and energy states from ground states to highly excited states, and the cross-sections of each charge state and energy state need to be calculated. The bottleneck limiting computational performance is the unavoidable relativistic effects of middle to high-Z atoms and the incredibly complex electronic configurations. Taking tantalum (Ta) as an example, by using the relativistic Dirac-Fock theory and distorted wave model, we computed the electron-impact ionization and excitation cross-sections of Ta from the ground state atom up to Ta<sup>72+</sup> with the incident electron energy range of 0-150keV. The detailed configuration accounting (DCA) reaction channel cross-sections are derived by summing and weighting the original detailed level accounting (DLA) cross-sections. After examining the data, two regularities are found. In terms of DLA, the pre-averaging DCA cross-sections have varying initial DLA energy levels but are typically close to one another, but there isn't a straightforward function that can explain the discrepancies between them. In terms of DCA, inner subshells typically contribute very little to the total cross-section as their ionization and excitation cross-sections are orders of magnitude smaller than those of outer subshells. We provide two techniques to reduce the computational costs based on the regularities. To minimize the overall number of DLA reaction channels used in the computation, the initial DLA energy levels can be randomly sampled. Through a Monte Carlo numerical experiment, we determine the appropriate number of sampling points that can reduce the total number of DLA channels by an order of magnitude while maintaining a 5% error margin. In terms of impact ionization, since small cross-section DCA channels are insignificant, only a tiny portion of the DCA channels are required to preserve a 95% accuracy of the entire cross-section. It is possible to use the analytical Binary Encounter Bethe (BEB) formula to determine which DCA channels should be neglected before the computation to reduce computational costs. In terms of electron-impact excitation, just the cross-sections of the same excited subshells as the preserved ionized subshells, which are determined in the previous electron-impact ionization (EII) calculation, are needed. Lastly, we compared our EII results with theoretical and experimental results. In the low incident electron energy range of below 2 keV, our results agree with the theoretical result of the 6s EII cross-section of the Ta atom and the experimental result of the total EII cross-section of the Ta<sup>1+</sup> ion. In the high energy range of below 150 keV, our results are also consistent with the theoretical results of the 1s EII cross-section of the Ta atom and the experimental result of the 1s EII cross-section of the Cu atom. Our results reasonably matched the previous experiment and theoretical results in both low and high energy ranges, inner and outer subshells, indicating the accuracy of our calculation. The proposed optimizing strategy can be applied to various middle to high-Z elements and is compatible to most computation codes.