17 ms·
Is 4096 types enough for everyone? https://github.com/apache/fory/blob/fd1d53bd0fbbc5e0ce6d53ef7a2ca06935539abf/java/fory-core/src/main/java/org/apache/fory/re
by no_circuit 11mo ago
Is 4096 types enough for everyone?
https://github.com/apache/fory/blob/fd1d53bd0fbbc5e0ce6d53ef7a2ca06935539abf/java/fory-core/src/main/java/org/apache/fory/resolver/XtypeResolver.java#L108-L109 https://github.com/apache/fory/blob/fd1d53bd0fbbc5e0ce6d53ef...
- chaokunyang 11mo agoProbably not for everyone. The current limit of 4096 types could be expanded if there’s a real need — it’s not a hard technical barrier. I’m curious though: what’s an example scenario you’ve seen that requires so many distinct types? I haven’t personally come across a case with 4,096+ protocol messages defined.
- no_circuit 11mo agoIf your binary has a small function set, probably not. But in a use case if you want to proxy/intercept cloud APIs, then something like Google APIs has 34K message types: git clone https://github.com/googleapis/googleapis.git cd googleapis find . -name '*.proto' -and -not -name '*test*' -and -not -name '*example*' -exec grep '^message' {} \; | wc -l I think this more speaks to the tradeoff of not having an IDL where the deserializer either knows what type to expect if it was built with the IDL file version that defined it, e.g., this recent issue: https://github.com/apache/fory/issues/2818 https://github.com/apache/fory/issues/2818 But now I do see that the 4096 is just arbitrary: If schema consistent mode is enabled globally when creating fory, type meta will be written as a fory unsigned varint of type_id. Schema evolution related meta will be ignored.