Skip to content

Exploration: lazily load 2-step funnel on first render#6273

Merged
aerosol merged 6 commits intomasterfrom
exploration-opts-rebase
Apr 23, 2026
Merged

Exploration: lazily load 2-step funnel on first render#6273
aerosol merged 6 commits intomasterfrom
exploration-opts-rebase

Conversation

@aerosol
Copy link
Copy Markdown
Member

@aerosol aerosol commented Apr 22, 2026

Changes

To make the exploration more encouraging to play with, we'll be preloading some funnel guesswork in "Explore" section by default. Defensively, we'll also query a smaller number of step candidates while building it.

Tests

  • Automated tests have been added
  • This PR does not require tests

Changelog

  • Entry has been added to changelog
  • This PR does not make a user-facing change

Documentation

  • Docs have been updated
  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode
  • This PR does not change the UI

@github-actions
Copy link
Copy Markdown

Preview environment👷🏼‍♀️🏗️
PR-6273

@aerosol aerosol force-pushed the exploration-opts-rebase branch from 40a11b0 to cd44aea Compare April 23, 2026 04:44
@aerosol aerosol changed the title [wip] Exploration: load interesting funnel on first render Exploration: load interesting 2-step funnel on first render Apr 23, 2026
@aerosol aerosol changed the title Exploration: load interesting 2-step funnel on first render Exploration: load 2-step funnel on first render Apr 23, 2026
@aerosol aerosol changed the title Exploration: load 2-step funnel on first render Exploration: lazily load 2-step funnel on first render Apr 23, 2026
@aerosol aerosol marked this pull request as ready for review April 23, 2026 04:58
@aerosol aerosol requested a review from zoldar April 23, 2026 04:58
Copy link
Copy Markdown
Contributor

@zoldar zoldar left a comment

Choose a reason for hiding this comment

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

Nice work civilising the API with those opts.

Comment thread assets/js/dashboard/extra/exploration.js
url.apiPath(site, '/exploration/interesting-funnel'),
dashboardState,
{}
{ max_steps: 2, max_candidates: 6 }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

JFTR, at least for the current implementation(s) of the exploration, whether we fetch 6 or 20 candidates does not really affect query performance that much.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

even for extreme sites?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, I think so. The majority of work is done in the 2 innermost queries where ordering must happen on the whole resultset. Also, sort of counter-intuitively, the longer the funnel, the more performant the query because more of the transitions are filtered out early. Selecting from the sorted set is a tiny factor (that is unless you fetch by the thousands where the payload size/serialization and deserialization overhead might be more relevant)

@aerosol aerosol added this pull request to the merge queue Apr 23, 2026
Merged via the queue into master with commit 9839237 Apr 23, 2026
22 checks passed
@aerosol aerosol deleted the exploration-opts-rebase branch April 23, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants