I assume You are asking about
SQL Server database, right?
Neither of those two operations is really responsible for improving performance (and shrink doesn't improve anything about database performance/speed).
dbcc shrink is bad?
- increases load on server and requires additional maintenanace time
- database (indexes) get heavily fragmented as a result of shrinking algorithms - this might lead to database growth on index rebuild/reorganize
FULL RECOVERY mode every page movement made by shrink is logged in transaction log, hence log file grows a lot faster.
More about cons to shrinking SQL Server databases in Brent Ozar's and Paul Randall's blog posts.
- Why defragmenting often doesn't improve performance?
Mostly because performance issues are hidden somewhere else and defragmenting indexes works as quick band-aid (that doesn't last long, tho). It could be issue with statistics not up to date, or other issues. Just like Brent Ozar and Kendra Little wrote in their articles.