Avatar for the langflow-ai user
langflow-ai
langflow
BlogDocsChangelog

refactor: add graph utility tests and refactor sorting methods

#5538
Comparing
refactor-sorting
(
0b28d04
) with
main
(
f080049
)
CodSpeed Performance Gauge
+75%
Improvements
2
Regressions
0
Untouched
13
New
0
Dropped
0
Ignored
0

Benchmarks

Improved

test_build_flow
src/backend/tests/unit/test_chat_endpoint.py::test_build_flow
CodSpeed Performance Gauge
+75%
703.4 ms
402.8 ms
test_build_flow_from_request_data
src/backend/tests/unit/test_chat_endpoint.py::test_build_flow_from_request_data
CodSpeed Performance Gauge
+74%
722.1 ms
414.5 ms

Passed

test_get_and_cache_all_types_dict
src/backend/tests/performance/test_server_init.py::test_get_and_cache_all_types_dict
CodSpeed Performance Gauge
+2%
1.1 ms
1.1 ms
test_load_flows
src/backend/tests/performance/test_server_init.py::test_load_flows
CodSpeed Performance Gauge
0%
1.1 ms
1 ms
test_create_starter_projects
src/backend/tests/performance/test_server_init.py::test_create_starter_projects
CodSpeed Performance Gauge
0%
969.7 ms
968.9 ms
test_initialize_services
src/backend/tests/performance/test_server_init.py::test_initialize_services
CodSpeed Performance Gauge
0%
154.6 ms
154.6 ms
test_starter_projects
src/backend/tests/unit/test_endpoints.py::test_starter_projects
CodSpeed Performance Gauge
0%
993.6 ms
994.3 ms
test_initialize_super_user
src/backend/tests/performance/test_server_init.py::test_initialize_super_user
CodSpeed Performance Gauge
0%
159.2 ms
159.4 ms
test_get_all
src/backend/tests/unit/test_endpoints.py::test_get_all
CodSpeed Performance Gauge
0%
451.3 ms
451.8 ms
test_setup_llm_caching
src/backend/tests/performance/test_server_init.py::test_setup_llm_caching
CodSpeed Performance Gauge
-1%
956.4 µs
963 µs
test_successful_run_with_input_type_text
src/backend/tests/unit/test_endpoints.py::test_successful_run_with_input_type_text
CodSpeed Performance Gauge
-2%
242.3 ms
246.8 ms
test_successful_run_with_input_type_any
src/backend/tests/unit/test_endpoints.py::test_successful_run_with_input_type_any
CodSpeed Performance Gauge
-2%
251.9 ms
257.3 ms
test_successful_run_with_output_type_debug
src/backend/tests/unit/test_endpoints.py::test_successful_run_with_output_type_debug
CodSpeed Performance Gauge
-2%
243.9 ms
249.5 ms
test_successful_run_with_output_type_any
src/backend/tests/unit/test_endpoints.py::test_successful_run_with_output_type_any
CodSpeed Performance Gauge
-5%
148.9 ms
157.1 ms
test_invalid_run_with_input_type_chat
src/backend/tests/unit/test_endpoints.py::test_invalid_run_with_input_type_chat
CodSpeed Performance Gauge
-8%
26.9 ms
29.1 ms

Commits

Click on a commit to change the comparison range
Base
main
f080049
+75%
refactor(graph): optimize dependency sorting and vertex filtering - Improved the `_max_dependency_index` function by utilizing `index_map.get()` for cleaner code and better handling of missing successors. - Enhanced the `_sort_single_layer_by_dependency` function with a caching mechanism to avoid redundant calculations, improving performance during vertex sorting. - Updated `filter_vertices_up_to_vertex` to use a set for `vertices_ids`, optimizing membership checks and enhancing efficiency in vertex filtering. These changes contribute to more efficient graph processing and improved code readability.
0b28d04
2 days ago
by ogabrielluiz
Home Terms PrivacyDocs