Stored procedures can run faster because the execution plan is cached by the sql server.
But 10 times the performance is suspicious. Is this done the first time you run it after you have cleared your saved execution plans? You can use these commands to clear the cache. But they clear the entire server cache, so only do this on development servers.
DBCC FREEPROCCACHE DBCC FLUSHPROCINDB (<dbid>)
Do you execute them directly on the SQL server to eliminate any network I / O operations during performance testing?
I assume that it runs slowly for the first time, and then when it is cached, it runs faster.
source share