Skip to content

SIMD types in dart:typed_data should have const constructors #31487

Open

Description

@yjbanov

Float32x4, Float64x2 and Int32x4 all should have const constructors. They are deeply immutable.

Activity

  1. added
    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
    type-enhancementA request for a change that isn't a bug
    on Nov 29, 2017
  2. gmpassos commented on May 29, 2021

    @gmpassos
    Contributor

    Just to enforce how this is important. They are immutable instances and we need to handle them as const, like we do with normal double and int values.

  3. gaaclarke commented on May 2, 2022

    @gaaclarke
    Contributor

    FYI we found evidence that vectorizing BoxConstraints could help customer: money's startup time. This is a blocking issue for exploring that. flutter/flutter#102931

  4. alexthe2 commented on Dec 12, 2023

    @alexthe2

    Are there any updates on this?

  5. modulovalue commented on Jul 20, 2026

    @modulovalue
    Contributor

    Adding const constructors would not help with vectorizing Flutter, because e.g. BoxConstraints need to have a constant constructor itself and the const over SIMD types would not help here without compiler magic on the Flutter side, but it would help with hoisting related performance issues where static finals can't be hoisted #63390.

    Symbols are also constant, but there are many edge cases to make it constant. It would be nice if we could somehow reduce the effort that is needed for making the SIMD types constant. I'm thinking of having a shared Simd128 type and extension types over that single type, but I think we should focus on having efficient and complete SIMD types first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions