ufcpp-live / UfcppLiveAgenda

@ufcpp live streaming agenda
MIT License
24 stars 2 forks source link

.NET Conf 2023 Recap Japan振り返りつつ忘年会配信 #84

Closed ufcpp closed 4 months ago

ufcpp commented 6 months ago

配信URL: https://www.youtube.com/watch?v=mSc59pbuG7w

.NET Night Party@品川とか行ってきたわけですが。 .NET Conf 2023 Recap Japan も振り返りつつ、歳忘れ配信。

.NET Night Party でやったクイズ大会、ライブコーディングの話とか、振り返り等々。

Base64 脳内エンコード大会。

ufcpp-live commented 6 months ago
using System.Runtime.InteropServices;

List<int> list = [1, 2, 3, 4, 5];

// コレクション式 new() { 1, 2, 3, 4, 5 } だと、以下のような解釈。
List<int> list = new();
list.Add(1);
list.Add(2);
list.Add(3);
list.Add(4);
list.Add(5);

// こっちの方が最速。だいぶ速いはず。
// 今、list = [1, 2, 3, 4, 5] はこの類に解釈される。
List<int> list = new();
CollectionsMarshal.SetCount(list, 5);
var span = CollectionsMarshal.AsSpan(list);
span[0] = 1;
span[1] = 2;
span[2] = 3;
span[3] = 4;
span[4] = 5;