iMac 21.5 Core i3 mid 2010 optical bay swap SSD
You shouldn't get slower speeds because both SATA ports are SATA II (3Gb/s).

You can confirm this by going to About This Mac >> System Report.  Then, go down to SATA/SATA Express and select the chipset controlling your optical drive.

(I don't have an optical drive for this example, unfortunately, so mine shows my SSD, but the concept is the same)

Look for Link Speed and Negotiated Link Speed.  Link Speed is what the interface is capable of (SATA II/3Gb/s) and Negotiated Link Speed is what the connected device is capable of delivering (SATA I/1.5Gb/s for SuperDrive).  



Provided that both of your SATA ports are SATA II, then the only factor that could slow down the performance would be the caddy; so ensure that you get one that's SATA II or SATA III.

Also, keep in mind that all new SSDs are all SATA III, but they are backward compatible so, even though they are capable of 6Gb/s, the most you'll get is 3Gb/s.