That’s definitely the best way at a grocery store. They even do the math for you, on both regular and sale price stuff. My favorite is when only the 12oz box of cereal is on sale for a lower per-oz cost than the 18 oz boz that is cheaper when neither is on sale.
What’s annoying is when one item uses a per-unit of weight and another count for two products that should have the same units.
The one that gets you here, is after you’ve grown accustomed to brand A being cheaper than brand B, then brand A changes it’s package to a smaller quantity in the same size. Since you probably don’t check everytime that stealth price increase slides through. Like the jar of peanut butter that shaves off half an oz by indenting the base.