Skip to content

Conversation

@koerberm
Copy link
Contributor

This PR outdates PR #419. It contains the executor as well as a proof-of-concept implementation of a task-scheduler.
The scheduler collects tasks (e.g., computation) for a fixed amount of time (e.g., 100ms) and tries to merge multiple small tasks into one bigger task to avoid redundant computations.
This is especially useful if clients request data in a tiled fashion.

koerberm and others added 30 commits November 23, 2021 16:36
# Conflicts:
#	services/Cargo.toml
# Conflicts:
#	services/src/error.rs
Co-authored-by: Christian Beilschmidt <[email protected]>
# Conflicts:
#	operators/src/error.rs
#	services/src/pro/contexts/in_memory.rs
Restricted Hash and Eq implementation to concrete Key type
# Conflicts:
#	operators/src/error.rs
# Conflicts:
#	services/src/error.rs
…atic result stream. This commit contains implementations for VectorQueryProcessor and RasterQueryProcessor.
# Conflicts:
#	services/src/error.rs
# Conflicts:
#	services/src/util/config.rs
# Conflicts:
#	services/src/error.rs
#	services/src/util/config.rs
# Conflicts:
#	datatypes/src/collections/feature_collection.rs
@koerberm
Copy link
Contributor Author

debug!("Scheduling tasks.");
Self::schedule(executor, new_tasks, threshold).await;
debug!("Finished scheduling tasks.");
});
Copy link
Contributor

Choose a reason for hiding this comment

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

await it?

/// Schedules the given set of tasks. Merging of tasks is performed, if
/// the occurring dead space is below the given threshold.
async fn schedule(executor: Arc<Executor<Desc>>, tasks: TaskMap<Desc>, threshold: f64) {
let merged_tasks = tokio::task::spawn_blocking(move || Self::merge_tasks(tasks, threshold))
Copy link
Contributor

Choose a reason for hiding this comment

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

this is already inside a tokio task, why spawn another one?

}

/// Merges the tasks with the given threshold
fn merge_tasks(tasks: TaskMap<Desc>, threshold: f64) -> TaskMap<Desc> {
Copy link
Contributor

Choose a reason for hiding this comment

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

test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants