Skip to content

Improve SpecApi performance (direct plotlist usage) - #5755

Draft
ffreyer wants to merge 3 commits into
ff/breaking-0.25from
ff/specapi
Draft

Improve SpecApi performance (direct plotlist usage)#5755
ffreyer wants to merge 3 commits into
ff/breaking-0.25from
ff/specapi

Conversation

@ffreyer

@ffreyer ffreyer commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Description

In reference to #5717

This adds a specialized constructor for PlotList as well as connect_plot!(scenelike, ::PlotList) to remove all the plot setup that plotlist does not make use of. I.e. the whole argument conversion pipeline, default attributes, theming, cycling, float32converts, etc. In my local benchmarks this cuts down

@benchmark plotlist!(scene, PlotSpec[]) setup = (scene = Scene())

from around 15µs min to about 9µs min (mean ~19 to ~10)

This also makes changes to how convert_argument methods producing plotspecs are processed. In theory that should also speed things up, in practice it seems to only be marginally faster.

TODO:

  • check BlockSpec and GridLayoutSpec for similar improvements
  • see what tests say

As a side node, I noticed that plotlist! kind of but not really inherits attributes down to the plot spec plots. Specifically, it forwards what's in plot.kw, i.e. the initially given attributes. These attributes overwrite whatever the Spec sets and will always remain at their initial state. This seems wrong to me and I'd expect either:

  • plotlist passed no attributes whatsoever to spec plots
  • plotlist attributes act as defaults for spec plots (i.e. spec plots overwrite) and:
    • If plotlist attributes update, the next construction of spec plots should read the updated attributes
    • If plotlist attributes update and are used by a spec plot, the spec plot also updates

Type of change

  • performance improvements (non breaking?)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@github-project-automation github-project-automation Bot moved this to Work in progress in PR review Aug 23, 2026
@ffreyer ffreyer mentioned this pull request Aug 28, 2026
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Work in progress

Development

Successfully merging this pull request may close these issues.

1 participant