Skip to content

EXPERIMENT - DO NOT MERGE - ability to stop path execution from a DataFetcher - #2950

Closed
bbakerman wants to merge 1 commit into
masterfrom
stop_path_execution
Closed

bbakerman wants to merge 1 commit into
masterfrom
stop_path_execution

Conversation

@bbakerman

@bbakerman bbakerman commented Sep 9, 2022 •

Copy link
Copy Markdown
Member

This is an experiment - this is not guaranteed to be merged as is IF at all.

I wanted to explore what it might take to allow a data fetcher to return a value and say "no more processing" from here

This I think is how it could be done.

I wrote a benchmark to demonstrate a completed long list versus a list that just stops.

Benchmark                                        Mode  Cnt     Score     Error  Units
StopQueryBenchMark.benchMarkLongListThroughput  thrpt   15   182.618 ±   7.967  ops/s
StopQueryBenchMark.benchMarkStopListThroughput  thrpt   15  9537.733 ± 193.399  ops/s
StopQueryBenchMark.benchMarkLongListAvgTime      avgt   15     5.655 ±   0.198  ms/op
StopQueryBenchMark.benchMarkStopListAvgTime      avgt   15     0.104 ±   0.003  ms/op

This has some trade offs of course

  • leaf node coercing DOES it happen
    • the returned object better be correct to the schema type system
  • sub selection reduction does not happen
    • the returned object should fit the sub selection (and fit the type system)
  • the __typename sub selection can NEVER run - since we never ran the sub selection
  • instrumentation does not run for the sub selection

@bbakerman bbakerman changed the title WIP - ability to stop path execution from a DataFetcher EXPERIMENT - DO NOT MERGE - ability to stop path execution from a DataFetcher Sep 9, 2022
@bbakerman bbakerman added Not to be merged spikes or other stuff that should never or not yet to be merged performance work that is primarily targeted as performance improvements experimental labels Nov 30, 2022
@bbakerman bbakerman closed this Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimental Not to be merged spikes or other stuff that should never or not yet to be merged performance work that is primarily targeted as performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant