Optimizing /clear

I have a /clear @s specific item command in a function that runs every tick if the player doesnt match a certain condition I did a profiling test, and those /clear commands seem to be very heavy on performance. Any suggestions?
Continue to help post