Interactive traffic lacks no-op suppression: redundant view/density/sample re-ships

Open
#168 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript, python

Research direction

Start with the referenced request paths in js/src/53_interaction.ts and js/src/54_kernel.ts, then compare the cache behavior in js/src/45_lod.ts with the density and sample handlers in python/xy/interaction.py. Read spec/design/lod-architecture.md for the intended edge-tile behavior. Done means redundant view, density, and sample traffic is suppressed without changing visible chart results.

Written by the indexing model from the issue text.

Description

needs investigate performance

From a full data-transport audit at b0f8780. Three related sources of redundant interactive traffic:

  1. No client-side no-op suppression for view requests — every non-animated _setView schedules a request (js/src/53_interaction.ts:1548); js/src/54_kernel.ts:12-78 never compares against the last-served window. A y-only pan sends an unchanged x-window and the kernel re-runs M4 for every decimated trace (python/xy/interaction.py:308-347), re-shipping byte-identical tier updates (~64 KiB per line trace at 2048 px).
  2. Density grids re-ship whole on pans the pyramid already covers — the client caches up to 8 grids per trace (js/src/45_lod.ts:198-220) but only for stale-while-revalidate drawing, not coverage checks; the spec's phase-3 "pan ships only newly exposed edge tiles" is documented but unimplemented (spec/design/lod-architecture.md:187-189). During wheel zoom this is one plot-sized grid (~400 KB) per ~130 ms per density trace.
  3. Density sample overlay fully re-ships on every exact re-bin_density_sample_update (python/xy/interaction.py:432-487) re-samples with a fixed seed, so overlapping views select largely overlapping rows; up to 8192 points x all channels (~100-200 KiB) per view settle. The standalone client already retains its sample and re-bins locally with a span gate (js/src/54_kernel.ts:98-130) — precedent for sample: {unchanged: true} replies keyed by (seed, level, window-of-validity).

Proposed fixes: client memo of last-served (window, px) per request kind; kernel-side short-circuit when the window equals the previous request; sample-unchanged replies; eventually the spec'd keyed edge-tile shipping.

Dominant language
Python
Stars
1.8k
Forks
76
Avg merge
1h 7m
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reflex-dev/xy

All issues in reflex-dev/xy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.