|
What is the benefit of using a code:
code:
|
# ¿ Feb 11, 2019 00:34 |
|
|
# ¿ May 11, 2024 23:47 |
|
Joda posted:In terms of raw performances, a value map is probably faster than a reference map on iteration or repeated access due to lower rate of cache aliasing for objects contiguous in memory Ok, so as a general rule if you just plan to frequently read from a map of immutable structs then there are benefits to just using a value map. Otherwise mutating the map or the structs themselves use pointers?
|
# ¿ Feb 11, 2019 01:06 |
|
Linux Nazi posted:pre-write structs to deal with the dozens, sometimes hundreds of different responses? By literally writing dozens, sometimes hundreds of structs? Really? Yeah this is what is done in statically typed languages in my experience. Tooling usually makes it easier, like in C#/VS you can just import a huge json structure and it'll create all the classes for you. A couple of refactoring commands later they are all in seperate files with correct formatting and naming conventions applied. This probably comes down to personal preference but I would for sure prefer a stack of structs over a map of interface{}'s.
|
# ¿ Jul 10, 2020 06:25 |