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

client: fibo example is slow #154

Open
EdAyers opened this issue Dec 19, 2022 · 0 comments
Open

client: fibo example is slow #154

EdAyers opened this issue Dec 19, 2022 · 0 comments
Labels
client Related to HitSave Python client performance tech debt Needs judgement for when it's valuable enough to resolve

Comments

@EdAyers
Copy link
Contributor

EdAyers commented Dec 19, 2022

@experiment
def fibo(n):
    print(f"computing fibo({n})")
    if n < 3:
        return 1
    else:
        return fibo(n - 1) + fibo(n - 2)


print(fibo(50))

Takes ages because it is pickling and unpickling these numbers.
There are a few things slowing this down:

  • Eval uploads should be batched or async streamed.
  • Even if the eval is stored locally, it needs to be unpickled from the local cache. There should be special support for basic scalar result types like strings and numbers.
  • There should be an @cache in-mem cache too. At least a weakref system.
@EdAyers EdAyers added tech debt Needs judgement for when it's valuable enough to resolve client Related to HitSave Python client performance labels Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Related to HitSave Python client performance tech debt Needs judgement for when it's valuable enough to resolve
Projects
None yet
Development

No branches or pull requests

1 participant