A series of dyes based on a porphyrin donor and a cyanoacrylic acid anchor/acceptor group for solar cell application are investigated with regards to varied-length π-spacers affecting the photo-to-electric conversion efficiency (PCE). Investigations are firstly performed on three porphyrin sensitizers with 1-3 conjugated phenylethynyl (PE) units, which have experimentally proved that the efficiency of power conversion decreases systematically with increasing spacer length. The distances and amounts of charge transfer after photoexcitation are calculated. In the PE bridged porphyrin dyes, the calculated electron injection driving forces and the regeneration driving forces gradually decrease as the distance of the π-spacer increases. Our theoretical calculations can reproduce well the experimental conclusion, showing that the photo-to-electric efficiency has a strong distance dependence for the electron-rich phenyl spacer. Then we replace the phenyl group with a pyrimidyl (PM) group to uncover how the characteristics of the π-spacer affect the performance of optical absorption, charge separation, and the regeneration process, to further improve the power conversion. We find that the adoption of electron-deficient pyrimidyl can break and even remove the distance dependence of the π-spacer. Some integral factors affecting the dye performance, such as short-circuit photocurrent, open-circuit voltage and charge collection efficiency are analyzed. It would help to interpret what role the electron deficient π-spacers with varied lengths will play and how they are expected to behave in the performance of sensitizers. In this regard, this study presents us with a promising way to design novel functional dyes and to utilize the potential advantages of the lengthy spacer dyes.