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

fix: Fix some blocking usages of messages memory #4485

Closed
wants to merge 2 commits into from

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Nov 9, 2024

Fix some blocking usages of messages memory (functions from langflow/memory.py)

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Nov 9, 2024
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Nov 9, 2024
Copy link

codspeed-hq bot commented Nov 9, 2024

CodSpeed Performance Report

Merging #4485 will degrade performances by 28.58%

Comparing cbornet:async-memory (384383f) with main (f8f9b7c)

Summary

❌ 1 regressions
✅ 14 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main cbornet:async-memory Change
test_successful_run_with_input_type_text 412 ms 576.8 ms -28.58%

Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are sync because put_nowait is sync, IIRC. Should we make them all async? Would make the DX a bit better

@cbornet
Copy link
Collaborator Author

cbornet commented Nov 11, 2024

These are fixes for code using functions from langflow/memory.py which uses the DB in a sync way.
We can also add async functions to this module but I think we'll need to keep the sync ones for LCBuiltinChatMemory (or we throw NotImplementedError in the sync methods such as LCBuiltinChatMemory.add_messages ?).

@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Nov 11, 2024
@ogabrielluiz
Copy link
Contributor

I think we can change them all to async

@cbornet
Copy link
Collaborator Author

cbornet commented Nov 18, 2024

Closing in favor of #4665

@cbornet cbornet closed this Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants