Which OS is faster for my iMac Early 2009?
I'm was sorely rempted to -1 your question and then comment, but the comment grew long. You're just trying to make the most of what you have and asking for advice so that's a +1 now.

Unless you define what "fast" is - it's hard for this not to be entirely speculative. Worse, when you define fast - then you make it very narrow and less useful. 

The OS doesn't really change your CPU and your memory speeds. It doesn't change your filesystem and since you can't run High Sierra and APFS - you're stuck on HFS+ for that Mac.

About the best thing that can come of this "let's get an answer on which is faster - 10.11 or 10.12 or 10.10" is the suggestion to partition your drive and test each OS to your needs and then make your call. 

The downside is you'll likely lose so much more time doing the measuring than just installing the latest OS that runs and then look to optimize what your bottleneck is when you reach them. Another downside would be if someone saw "10.12 is slow" and it discourage them from upgrading when for them it would be faster and/or more secure and no more slow.

I'd say - make a good backup, and then upgrade to the latest OS you can. Old software and not keeping your drive clean from needless files is likely to be far slower than whatever marginal difference you could ever measure on OS versions.

The upside of this is you'll have learned some skills on measuring performance and thinking about the end goal "swift and Xcode" and then can make decisions like - should I spend $$ on RAM and SSD or find a used Mac with those that is more economical than upgrading a core2 duo machine.