I am trying to figure out what part of a complicated smart contract transaction is responsible for the cost. I was wondering if there is already a tool for that. Ideally it would spit out you are spending this much gas on this kind of opcode or storage op etc. It would be great for writing optimized computation "heavy" smart contracts.
there is another option I'm trying out right now sol-profiler buy the guys at 0x project
Sol-profiler gathers line-by-line gas usage for any transaction submitted through your provider. This will help you find unexpected inefficiencies in parts of your smart contract, and take a data-driven approach to optimizing it.