Skip to content

Discuss performance implications of generics in language documentation #4998

Closed
@modulovalue

Description

@modulovalue

Page URL

https://dart.dev/language/generics.html

Page source

https://github.com/dart-lang/site-www/tree/main/src/language/generics.md

Describe the problem

The "Note" under https://dart.dev/language/generics#generic-collections-and-the-types-they-contain explains that generics are reified, but it doesn't mention anything about the impact that this has on the runtime performance of generics. Rust, for example, appears to monomorphize everything and Java appears to monomorphize nothing.

Expected fix

It might be useful to mention how well generics perform during runtime. That is, is there always some overhead associated with generics? Are there ways to (automatically) get rid of any overhead for the cost of larger binaries? (Cf. dart-lang/sdk#52722)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    a.languageRelates to the Dart language tourd.enhancementImproves docs with specific aske1-hoursCan complete in < 8 hours of normal, not dedicated, workp3-lowValid but not urgent concern. Resolve when possible. Encourage upvote to surface.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions