Skip to content

Commit 2fbc0b1

Browse files
committed
Improve documentation
1 parent 20cf6a5 commit 2fbc0b1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/gleam/string.gleam

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,14 @@ fn erl_split(a: String, b: String) -> List(String)
359359

360360
/// Creates a new `String` by joining two `String`s together.
361361
///
362-
/// This function copies both `String`s and runs in linear time. If you find
363-
/// yourself joining `String`s frequently consider using the [`string_tree`](../gleam/string_tree.html)
364-
/// module as it can append `String`s much faster!
362+
/// This function typically copies both `String`s and runs in linear time, but
363+
/// the exact behaviour will depend on how the runtime you are using optimises
364+
/// your code. Benchmark and profile your code if you need to understand its
365+
/// performance better.
366+
///
367+
/// If you are joining together large string and want to avoid copying any data
368+
/// you may want to investigate using the [`string_tree`](../gleam/string_tree.html)
369+
/// module.
365370
///
366371
/// ## Examples
367372
///

0 commit comments

Comments
 (0)