cosmos / cosmos-proto

Other
37 stars 15 forks source link

Explore generic map and list wrappers for fast reflection #15

Open aaronc opened 3 years ago

aaronc commented 3 years ago

As a follow-up to #8, let's explore a way to have generic map and list wrapper types rather than doing codegen for each of them.

technicallyty commented 3 years ago

we can do lists by just using []interface{} but i believe this would require a good amount of reflection - is speed not as important for this or should we explore a different way to handle generic list?

fdymylja commented 3 years ago

Considering that it might need to respect mutability constraint the only way we could do that is with heavy reflection, which would harm performance by 10 times I think, which would kill the purpose of having fast reflection.

I'd go with the golang generics path, once available (should come by end of 2021 start of 2022).