I'd have to check this to be sure, but IIRC there's very little in it, providing that you use parameterized queries, and not purely dynmically generated SQL with statically encodes parameter values. E.g. simplistically, suppose you ran 3 queries like so (in pseudocode):
SQLText = "select * from table where x = 1;"
Execute()
SQLText = "select * from table where x = 2;"
Execute()
SQLText = "select * from table where x = 3;"
Execute()
In this case, each of these queries would be seperately optimised/compiled for execution, incurring the cost 3 times. However if your code did:
SQLText = "select * from table where x = ?;"
Param[0] = 1
Execute()
Param[0] = 2
Execute()
Param[0] = 3
Execute()
Then the optimisation would happen only once. Even if you replaced the SQL text everytime, as long as the text was the same, the plan would already be cached by the server and would not have to be redone. So as long as you use parameterized queries, you should get nearly SP like performance, IIRC.