Swift Struct vs. Class Performance

14.07.2016
• Cornelius Horstmann

In the game that Michael and I are developing for our project derbe.cool we frequently use immutable structs that are copied and mutated multiple times for every user activity. That’s when I started to wonder what the performance difference is between copying a struct vs. a class.

A comparison of simple structs and classes using only value types or only referency types shows a huge difference.