The door in this room is a "bastard door", so using a diagonal input to walk out of the doorway will slow Link's movement to 1px/frame instead of 1.5px/frame, losing 2 frames. If going for the cardinal movement, keep in mind that you also lose time if you don't switch to a diagonal input early enough.
The two videos above show the most common strategies used to collect the chest and then exit the room.
The first strategy intentionally takes a hit from the left firebar after opening the chest, costing 1 heart on the way out.
The second strategy is over a second slower, but both avoids the damage and collects the heart underneath the bottom pot. You must walk all the way to the bottom of the room in order to avoid falling when hookshotting to the pot.
When taking a hit from the firebar, it's sometimes possible for the knockback to send you so far left that you end up in the slip zone for the pit. While it's possible to recover from this, doing so actually costs extra time compared to simply falling into the pit, which takes an extra heart of damage but ends up even with the normal strategy.
If you get to the chest quickly enough, it's possible to hookshot to the left after a quick down-left movement in order to gain invincibility frames and have the firebar pass through you before dashing. This is tricky to execute but avoids taking the heart of damage and only costs about 10 frames.
Without the hookshot, it's still possible to beat the firebars and open the chest before getting hit. Avoid moving diagonally too early, as this will cause you to get caught on the corner of the pit. Generally this strategy requires you to align Link with the very middle of the chest, as attempting to open it from the left side will fail due to the firebar hitbox being too close.
A capedash can avoid the firebar hits entirely and save roughly 13 frames, but at the cost of ~22 magic (around 1/6th of a bar). This is generally not recommended, as magic is best saved for use in other rooms in the dungeon.