Skip to content

Exponential slowdown with cross-referencing oneOf/anyOf definitions #4990

@adamrimon

Description

@adamrimon

Prerequisites

What theme are you using?

other

Version

6.4.1

Current Behavior

Schemas where definitions reference each other through oneOf/anyOf become unresponsive at deeper nesting levels. The time to select an option grows exponentially with depth.

Using the attached schema (5 definitions, each with a child property whose oneOf references the other 4), here are the measured times:

Nesting depth Time to select an option
8 4s
9 13s
10 49s

The time roughly triples with each additional level. With more definitions, the freeze happens at shallower depth.

Expected Behavior

The form should remain responsive regardless of the number of definitions or depth.

Steps To Reproduce

  1. Open the playground with this schema (5 definitions, A through E, each referencing the other 4 via oneOf).
  2. Start selecting nested options: pick a type for child, then pick a type for that child's child, and so on.
  3. Around depth 8-9 the form freezes for a noticeable number of seconds.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions