Add hotter cam or Add hotter head ?

I can tell you this much, from my families experience and others that I know that have done this.... putting stock good 340 heads on a 318 really... really wakes them up. !
I did stock 360 heads with a an erson 292 .441" lift on my 74 318 I had and it was a dog anything under 3,000 rpm but would come on strong until the valves floated at 5 grand