Skip to content

Instantly share code, notes, and snippets.

View meg4cyberc4t's full-sized avatar

Igor Molchanov meg4cyberc4t

View GitHub Profile
@PlugFox
PlugFox / main.dart
Last active September 10, 2025 05:43
Performance benchmark of different ways to append data to a list in dart, BytesBuilder vs AddAll vs Spread vs Concatenation
// ignore_for_file: curly_braces_in_flow_control_structures
/*
* Performance benchmark of different ways to append data to a list.
* https://gist.github.com/PlugFox/9849994d1f229967ef5dc408cb6b7647
*
* BytesBuilder | builder.add(chunk) | 7 us.
* AddAll | list.addAll(chunk) | 594 us.
* Spread | [...list, ...chunk] | 1016446 us.
* Concatenation | list + chunk | 1005022 us.