# Order of properties is it important in struct?

**URL:** <https://forums.kodeco.com/t/order-of-properties-is-it-important-in-struct/169411>\
**Category:** Expert Swift\
**Created:** [April 20, 2022, 5:51am UTC](https://forums.kodeco.com/t/order-of-properties-is-it-important-in-struct/169411 "2022-04-20T05:51:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emoonadev](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/emoonadev/32/102075_2.png) [@emoonadev](https://forums.kodeco.com/u/emoonadev)\
**Post date:** [April 20, 2022, 5:51am UTC](https://forums.kodeco.com/t/order-of-properties-is-it-important-in-struct/169411/1 "2022-04-20T05:51:37Z")

</div>

Hi,

I’m reading the chapter about the pointers, I’m at Memory layout.

In the example of the book you have

```auto
struct IntBoolStruct { 
var intValue: Int 
var boolValue: Bool
}
MemoryLayout<IntBoolStruct>.size // returns 9
MemoryLayout<IntBoolStruct>.alignment // returns 8
MemoryLayout<IntBoolStruct>.stride // returns 16

```

And

```auto
struct BoolIntStruct { 
var boolValue: Bool 
var intValue: Int
}
MemoryLayout<BoolIntStruct>.size // returns 16
MemoryLayout<BoolIntStruct>.alignment // returns 8
MemoryLayout<BoolIntStruct>.stride // returns 16

```

I understand why it’s take more size.

My question is, in real app I need to take in consideration the orders of properties of my models if want to optimise memories? Or no need because it’s not expansive in memory?
