Skip to content

improve performance of sync* code on VM #37753

@mraleph

Description

@mraleph
  • Do not use Closure.clone to create clones of the :sync_body closure - instead change kernel transformation to put :sync_body into another closure and call that closure to produce a copy of :sync_body. Prototype change improves performance in JIT mode by 3x.
  • Disable argument type checks for sync-yielding functions because their arguments are guaranteed to match.
  • In _SyncIterator recognize yield* of a _SyncIterable and track the top of the iterator stack explicitly rather than delegating downwards which makes deep recursive yield* ineffecient. (Apparently dart2js does that which makes it more efficient than VM /cc @rakudrama ).

Related issue(PR) on Flutter side (flutter/flutter#36303). /cc @jonahwilliams

/fyi @mkustermann

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-performanceIssue relates to performance or code size

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions