[
https://issues.apache.org/jira/browse/IGNITE-23682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konstantin Orlov updated IGNITE-23682:
--------------------------------------
Fix Version/s: 3.0
> Sql. Avoid unnecessary task scheduling for simple plan
> ------------------------------------------------------
>
> Key: IGNITE-23682
> URL: https://issues.apache.org/jira/browse/IGNITE-23682
> Project: Ignite
> Issue Type: Improvement
> Components: sql
> Reporter: Konstantin Orlov
> Assignee: Konstantin Orlov
> Priority: Major
> Labels: ignite-3
> Fix For: 3.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> KvPlan unconditionally schedules completion of prefetch callback to another
> thread pool:
> {code:java}
> // KeyValueGetPlan.java
> public <RowT> AsyncCursor<InternalSqlRow> execute(...) {
> ...
> if (firstPageReadyCallback != null) { // firstPageReadyCallback is never
> null
> Executor executor = task -> ctx.execute(task::run,
> firstPageReadyCallback::onPrefetchComplete);
> result.whenCompleteAsync((res, err) ->
> firstPageReadyCallback.onPrefetchComplete(err), executor);
> }
> ...
> {code}
> The problem is that for single statement read operations this callback is not
> used, yet scheduling results in moderate performance penalty. Below are
> results acquired on MBP M3 simply replacing {{result.whenCompleteAsync}} -->
> {{{}result.whenComplete{}}}:
> {code:java}
> Before
> Benchmark (clusterSize) (fsync) Mode Cnt Score Error
> Units
> SelectBenchmark.sqlGet 1 false avgt 20 9.056 ± 0.407
> us/op
> After
> Benchmark (clusterSize) (fsync) Mode Cnt Score Error
> Units
> SelectBenchmark.sqlGet 1 false avgt 20 6.236 ± 0.448
> us/op
> {code}
> Let's revise usage of prefetchCallback and get rid of unnecessary scheduling,
> when possible.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)