Takeaways:

  • Use collection types judiciously. They have overhead.
  • Look out for empty collections. They are pure overhead. Sometimes, null can be a good alternative.
  • Collection types have default sizes that are all over the place. Sometimes it can be worth specifying the capacity at instance creation time.
  • Objects come with overhead. Use primitives where you can.

Iā€™m suddenly experiencing a craving for inline types and generics specialization