Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aware of msgspec' Struct #627

Closed
ssweber opened this issue Sep 20, 2023 · 2 comments
Closed

Aware of msgspec' Struct #627

ssweber opened this issue Sep 20, 2023 · 2 comments

Comments

@ssweber
Copy link

ssweber commented Sep 20, 2023

(sorry about the edits, somehow I clicked save before doing anything)

I've been curious at how to speed up dataclasses, and wondered if the team was aware of msgspec's Struct.

The author has a few interesting benchmarks, so I'd thought I'd share (hopefully this isn't unwanted noise).

  import (μs) create (μs) equality (μs) order (μs)
msgspec 9.92 0.09 0.02 0.03
standard classes 6.86 0.45 0.13 0.29
dataclasses 489.07 0.47 0.27 0.30
attrs 428.38 0.42 0.29 2.15
pydantic 371.52 4.84 10.56 N/A
  GC time (ms) Memory Used (MiB)
standard class 80.46 211.66
standard class with slots 80.06 120.11
msgspec struct 13.96 120.11
msgspec struct with gc=False 1.07 104.85
@ssweber ssweber changed the title Aware of msgspec' Aware of msgspec' Struct Sep 20, 2023
@ssweber ssweber closed this as completed Sep 28, 2023
@dolfinus
Copy link

Why closing?

@gvanrossum
Copy link
Collaborator

I never understood this issue (not enough context). It doesn't feel like it's relevant to the main purpose of this repo (discussion about interpreter performance). I believe the author understood that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants