Vitor Pamplona on Nostr: Android coding is a constant reminder of how much performance relies on you knowing ...
Android coding is a constant reminder of how much performance relies on you knowing the exact inner workings of your environment:
Today's case: `array.toList()` is 4x(!!) slower than `listOf(array)` to return exactly the same thing.
But don't worry, there is also `array.asList()`, which is just 2x slower and `Arrays.asList` which is slighly faster than `listOf`.
This is not confusing at all.
Published at
2024-03-16 15:59:41Event JSON
{
"id": "a93bc2b735651e169a0580b336f71da3340bd9c46806c7efc42ff451d57b8f19",
"pubkey": "460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c",
"created_at": 1710604781,
"kind": 1,
"tags": [],
"content": "Android coding is a constant reminder of how much performance relies on you knowing the exact inner workings of your environment: \n\nToday's case: `array.toList()` is 4x(!!) slower than `listOf(array)` to return exactly the same thing. \n\nBut don't worry, there is also `array.asList()`, which is just 2x slower and `Arrays.asList` which is slighly faster than `listOf`. \n\nThis is not confusing at all.",
"sig": "9898fec2100099c2308476dea616ecd8b9e1b435732ccb5d054801cac7fd45c229f036cbfcceaee8b171ae8950b3859211e05d99c1676ce89e05dc971e2de91d"
}