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

Overall performance improvement #212

Open
Carsopre opened this issue Oct 31, 2024 · 2 comments
Open

Overall performance improvement #212

Carsopre opened this issue Oct 31, 2024 · 2 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@Carsopre
Copy link
Collaborator

Kind of request

Changing existing functionality

Enhancement Description

Study the possibility of replacing simple dataclasses that just store information by TypedDict instead.
Through profiling we can see that performance drops considerably when using dataclasses. Whilst we like them because of t heir type hints we are now at a moment to balance readability with more performance-oriented code.

Use case

With the introduction of new strategies algorithms get more complex and naturally become slower (multiple array exploration).
Aside from algorithms we need to consider the possibility of moving to more efficient data structures.

Additional Context

No response

@Carsopre Carsopre added this to the Sprint 2024.4.2 milestone Oct 31, 2024
@Carsopre Carsopre added the enhancement New feature or request label Nov 5, 2024
@ArdtK
Copy link
Contributor

ArdtK commented Nov 6, 2024

Investigation findings:

  • A TypedDict class can't have properties, making the builder/construction of objects more extensive.
  • A TypedDict can't inherit from e.g. a protocol if the protocol itself is not a TypedDict.
  • Checking the instance type of a TypedDict object is only possible from Python 3.11.
  • Initializing a TypedDict class doesn't initialize all entries. Giving default values is not possible.
  • At initalization linting does not always shows which keys are missing.

@ArdtK ArdtK linked a pull request Nov 6, 2024 that will close this issue
6 tasks
@ArdtK
Copy link
Contributor

ArdtK commented Nov 7, 2024

Possible next steps:

  • Investigate custom linting.

@ArdtK ArdtK added the wontfix This will not be worked on label Nov 7, 2024
@ArdtK ArdtK removed this from the Sprint 2024.4.2 milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants