The browser is an abstraction layer. It will always be slower.
But all this does not matter because your user will not write 20 chat messages / second.
Edit: and as I said at the beginning - "I often feel I'm on another planet" - having this discussion with web developers trying to justify something that is not just bad but dumb in so many ways always gives me a chuckle, and I try to educate on why there are other things beside browsers, and its not a very good way to write software