Another is to limit your consumption of such foods to weekends or social occasions. Some people follow a so-called S policy: “no snacks, no seconds, no sweets—except on days that begin with the letter S.”
Or as one woman at my shul put it: calories dont count on shabbat