Ahhhh, he did have a set. I figured that's why you posted the hand.
As to your question its pretty much what Chuck said, it depends on your opponent, if he's LAG you're better off shoving right away. The only thing I can add is that it also depends on how your opponents percieve you, the table image that you've given. Generally you want to get as much as you can in there as fast as you can. If you've been mostly tight then perhaps a call on the flop and then a shove on his turn bet is the way to go, since he almost certainly will fire on the turn no matter what he has because pot is big.
Anyway, even if you lost you did the right thing putting all your money in there, you just got very unlucky, as I said before it wasn't your day. Don't question your play here, you didn't make a mistake.