In contrast to my initial estimate std::variant is still expensive if you don't use exceptions. We need to replace it with a tagged union. As it's public API we have to delay the 6.1 release for it.
|For Gerrit Dashboard: QTBUG-91717|
|338335,6||Replace std::variant with tagged union in QJSPrimitiveValue||dev||qt/qtdeclarative||Status: MERGED||+2||0|
|338695,2||Replace std::variant with tagged union in QJSPrimitiveValue||6.1||qt/qtdeclarative||Status: MERGED||+2||0|