Modern cars have knock sensors. The ignition timing and fuel curves are all based on the feedback of various sensors on the car. If a car is designed to bump up the ignition timing and it detects knock it will dial back the timing, this hurts fuel mileage and power.
The question is will your car pull the timing back running 87 octane. Most of the time no. My 2017 F150 is designed to run on premium fuel and E85 fuel. It will make more power and get better mileage. Same thing with the two Chrysler 5.7 Hemi engines I owned, they are designed for 89 octane.
In my experience the car will not perform better running the higher octane to offset the additional cost of higher octane fuel. Nothing scientific, just seat of the pants.
Of course there are high performance cars that should be running 91 octane or higher.