No typing lag on NFBA but lag on Mame

what is the problem with my mame?
i can type and people can type in my games on nfba and i don’t lag AT ALL
but when i play on mame and even a single period from me or someone else lags the game until the text disappears