How to understand the 320-byte heap footprint of UUID ?

Hello Cafe, I'm about to introduce UUID into my code, and see https://github.com/haskell-hvr/uuid/issues/24 https://github.com/haskell-hvr/uuid/issues/24 stating:
Currently, UUID is represented as data UUID = UUID {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 However, this suboptimal for 64bit archs (where GHC currently stores this a 320-byte Heap object); ...
According to https://wiki.haskell.org/GHC/Memory_Footprint https://wiki.haskell.org/GHC/Memory_Footprint I can understand each evaluated `Word32` on 64-bit hardware can take 2 words - 16 bytes, and given they are unpacked and strict, I think one whole UUID record should just take 64 bytes plus a few words, which is far less than 320 bytes. So how comes the 320 bytes? Thanks with regards, Compl

TL;DR bits, not bytes. It meant to say 320 bit. 4 * 64 (Each Word32 is stored as Word64) + one 64bit header. 5 * 64 = 320. It could be just 3 * 64 = 192. - Oleg On 27.7.2020 9.58, YueCompl via Haskell-Cafe wrote:
Hello Cafe,
I'm about to introduce UUID into my code, and see https://github.com/haskell-hvr/uuid/issues/24 stating:
Currently, |UUID| is represented as data UUID = UUID {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32
However, this suboptimal for 64bit archs (where GHC currently stores this a 320-byte Heap object); ...
According to https://wiki.haskell.org/GHC/Memory_Footprint I can understand each evaluated `Word32` on 64-bit hardware can take 2 words - 16 bytes, and given they are unpacked and strict, I think one whole UUID record should just take 64 bytes plus a few words, which is far less than 320 bytes. So how comes the 320 bytes?
Thanks with regards, Compl
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

I see, thanks! It's a relief, that huge overhead (as I wrongly perceived) really made me uncomfortable.
On 2020-07-28, at 00:21, Oleg Grenrus
wrote: TL;DR bits, not bytes.
It meant to say 320 bit.
4 * 64 (Each Word32 is stored as Word64) + one 64bit header.
5 * 64 = 320.
It could be just 3 * 64 = 192.
- Oleg
On 27.7.2020 9.58, YueCompl via Haskell-Cafe wrote:
Hello Cafe,
I'm about to introduce UUID into my code, and see https://github.com/haskell-hvr/uuid/issues/24 https://github.com/haskell-hvr/uuid/issues/24 stating:
Currently, UUID is represented as data UUID = UUID {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 However, this suboptimal for 64bit archs (where GHC currently stores this a 320-byte Heap object); ...
According to https://wiki.haskell.org/GHC/Memory_Footprint https://wiki.haskell.org/GHC/Memory_Footprint I can understand each evaluated `Word32` on 64-bit hardware can take 2 words - 16 bytes, and given they are unpacked and strict, I think one whole UUID record should just take 64 bytes plus a few words, which is far less than 320 bytes. So how comes the 320 bytes?
Thanks with regards, Compl
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (3)
-
Compl Yue
-
Oleg Grenrus
-
YueCompl