You might be pleased to hear that there are some changes coming that should improve things and some that I hope we can get in to improve things further, at least on dataclasses’ end.
In Python 3.15 dataclasses now imports a number of things lazily and avoids using them if possible, so the module import should come down (mostly it no longer imports inspect unless you create a class with no docstring and attempt to actually look at the __doc__).
I have a plan to make dataclasses class construction faster by avoiding the generation of unused methods - Faster (lazier) dataclasses - #18 by DavidCEllis - if I get this in it should bring down the type creation to be faster than namedtuple (from collections) and type creation including __init__ to be close to NamedTuple (from typing).
I think there are some small tweaks we can make to make creating frozen dataclass instances faster too. Currently both non-slotted and slotted classes use object.__setattr__ for assignment. Non-slotted classes could get a performance boost from writing directly to the instance __dict__ instead. attrs does this already, but defaults to making slotted classes. attrs slotted classes also get object.__setattr__ as a bound method on the instance which may explain the slight difference in performance that you see.