cosmos-proto icon indicating copy to clipboard operation
cosmos-proto copied to clipboard

Explore generic map and list wrappers for fast reflection

Open aaronc opened this issue 3 years ago • 2 comments

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.

aaronc avatar Aug 18 '21 14:08 aaronc

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?

technicallyty avatar Aug 30 '21 21:08 technicallyty

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).

fdymylja avatar Sep 01 '21 09:09 fdymylja