Perf regression: executing the same constrained listing/mapping type results in huge delegate chains #252

Closed
opened 2025-12-30 01:22:45 +01:00 by adam · 0 comments
Owner

Originally created by @bioball on GitHub (Nov 21, 2024).

Originally assigned to: @stackoverflow on GitHub.

For example, this code results in 500 delegates:

function foo(elem: Listing<Int>(length == 1)) =
  if (elem[0] == 500) elem[0]
  else foo(new { elem[0] + 1 })

res = foo(new Listing { 0 })
Originally created by @bioball on GitHub (Nov 21, 2024). Originally assigned to: @stackoverflow on GitHub. For example, this code results in 500 delegates: ```pkl function foo(elem: Listing<Int>(length == 1)) = if (elem[0] == 500) elem[0] else foo(new { elem[0] + 1 }) res = foo(new Listing { 0 }) ```
adam closed this issue 2025-12-30 01:22:45 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#252