Skip to content
New issue

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

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

Already on GitHub? # to your account

tests: Add performance benchmarks for database initialization and app startup #4367

Merged
merged 16 commits into from
Nov 4, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This pull request introduces benchmark tests to evaluate the performance of database initialization and application startup processes. Additionally, benchmark markers have been added to various test cases to help identify potential bottlenecks and ensure overall efficiency in the application setup. These enhancements aim to improve performance monitoring and facilitate future optimizations.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 2, 2024
Copy link

codspeed-hq bot commented Nov 3, 2024

CodSpeed Performance Report

Congrats! CodSpeed is installed 🎉

🆕 16 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks

  • test_create_starter_projects (389.6 ms)
  • test_get_and_cache_all_types_dict (1.1 ms)
  • test_initialize_services (137.5 ms)
  • test_initialize_super_user (139.5 ms)
  • test_load_flows (1.3 ms)
  • test_setup_llm_caching (1.1 ms)
  • test_build_flow (684.3 ms)
  • test_build_flow_from_request_data (688.2 ms)
  • test_get_all (507.9 ms)
  • test_invalid_run_with_input_type_chat (17.6 ms)
  • test_starter_projects (1 s)
  • test_successful_run_with_input_type_any (448.9 ms)
  • test_successful_run_with_input_type_chat (449.4 ms)
  • test_successful_run_with_input_type_text (448.8 ms)
  • test_successful_run_with_output_type_any (449.1 ms)
  • test_successful_run_with_output_type_debug (449.7 ms)

@ogabrielluiz ogabrielluiz force-pushed the add-some-benchmarks branch 2 times, most recently from fd6225d to 665cff6 Compare November 4, 2024 12:18
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 4, 2024
@ogabrielluiz ogabrielluiz enabled auto-merge (squash) November 4, 2024 18:47
Introduce benchmark tests to measure the performance of database initialization and application startup. This helps ensure efficiency and identify potential bottlenecks in the setup process.
Remove unnecessary benchmark call and simplify the database initialization test to enhance clarity and reliability in performance testing.
Introduce benchmarks for various service initialization functions and LLM caching to improve performance evaluations.
@ogabrielluiz ogabrielluiz merged commit cd3a747 into main Nov 4, 2024
28 checks passed
@ogabrielluiz ogabrielluiz deleted the add-some-benchmarks branch November 4, 2024 23:45
diogocabral pushed a commit to headlinevc/langflow that referenced this pull request Nov 26, 2024
… startup (langflow-ai#4367)

* feat: add benchmark markers to multiple test cases

* test: add performance tests for database initialization and app startup

Introduce benchmark tests to measure the performance of database initialization and application startup. This helps ensure efficiency and identify potential bottlenecks in the setup process.

* feat: update CodSpeed workflow to enhance test execution and duration tracking

* refactor: streamline performance tests for database initialization and app startup

* test: enhance app startup performance test with pytest benchmarking

* test: update benchmark for database initialization

Remove unnecessary benchmark call and simplify the database initialization test to enhance clarity and reliability in performance testing.

* chore: remove unnecessary pytest options from CodSpeed workflow

* Add environment setup for test_app_startup benchmark test

* Add benchmark test for app startup with database setup and flow loading

* Add benchmark markers to flow building tests in test_chat_endpoint.py

* perf: add benchmarks for service initialization and caching

Introduce benchmarks for various service initialization functions and LLM caching to improve performance evaluations.

* Remove unused benchmark marker from test function in test_chat_endpoint.py

* perf: initialize services in super user benchmark test

* Add benchmarking to test_create_starter_projects in performance tests

* Add asyncio threading to benchmark tests and remove benchmark fixture usage

* Remove database initialization benchmark test from performance suite
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants