Nonlinear optimization problems with cardinality constraints and risk measurements, particularly in the fields such as finance and risk management, have posed significant challenges. Portfolio optimization under these constraints requires effective algorithms and methodologies to improve performance. Thus, this study aimed to investigate in nonlinear optimization problems with cardinality constraints and risk measurements in fields like finance and risk management. Indeed, by using various algorithms and methodologies, this study aimed to improve the performance of portfolio optimization under these constraints. To measurement risk in portfolio programing, deemed as an application in nonlinear problems with cardinality constraints, VaR (value at risk), CVaR (conditional value at risk), RVaR (robust value at risk), and RCVaR (robust conditional value at risk) were used. Regularization techniques played a crucial role in optimizing non-smooth problems, addressing challenges arising from the non-smoothness of the constraints, thereby enhancing algorithm performance. By using some regularization algorithms, such as Scholtes, Kanzow-Schwartz, and Bordakov methods, an improvement in performance was obtained. Notably, sequential quadratic programming (SQP), which is an iterative optimization technique, was used to solve nonlinear programming problems by approximating the objective and constraints using quadratic functions. After a comparison of algorithms' performance was explored, the experiments indicated a significant enhancement in the performance of the SQP algorithm by using the Scholtes regularization technique. Thus, these findings show that SQP can be a promise method to solving this classification of cardinality-constraints nonlinear problems. The study introduces innovative optimization solutions to improve algorithmic performance in complex problems, contributing to advancements in finance and risk management approaches.