aligned with perf branches of QME and HQMF2JS