fastjson [question] Does FastJson use reflection ?

ufj5ltwl  于 2021-11-27  发布在  Java
关注(0)|答案(3)|浏览(319)

I was wondering if FastJson use reflection in its implementation ?
I am considering between FastJson and Kotlinx Serializer for my project, since I know that Kotlinx Serializer doesn't use reflection in its implementation therefore it doesn't suffer from reflection performance overhead https://blog.frankel.ch/performance-cost-of-reflection/.

xsuvu9jc

xsuvu9jc1#

In filedBase mode, only reflection will be used.

ewm0tg9j

ewm0tg9j2#

By default, fastjson uses ASM(a technique that dynamically generates/modifies .class bytecode files directly) instead of reflection, which can be toggled by using the annotation @JSONType(asm = true/false).

xam8gpfp

xam8gpfp3#

ASM default,and Reflection optional.

相关问题