2022-11-07: Performance improvements in .NET 7, Uno Platform 4.6, WCF Upgrade Assistant

Published on Monday, 07 November 2022

トピックス

Agenda - .NET Conf 2022

https://www.dotnetconf.net/agenda

11/9 (日本時間) から 11/11 まで行われる .NET Conf 2022 のセッションテーブル。

.NET Conf 2022 Recap Event 東京 ~ Microsoft Japan Community Event Tour Series - Microsoft Events

https://msevents.microsoft.com/event?id=3219140458

12/6 (火) に行われる .NET Conf 2022 のおさらいイベントが東京で開催される。会場は日本マイクロソフト本社、参加費は無料となっている。

「午後の部」と「夜の部」の二部構成で「午後の部」では .NET Conf 2022 で発表された新しい技術の紹介や解説、「夜の部」では懇親会や Ask the Speaker、コミュニティーによるライトニングトークなどが予定されている。

Create your .NET portfolio in the .NET Conf student zone - .NET Blog

https://devblogs.microsoft.com/dotnet/dotnet-conf-2022-student-zone/

.NET Conf で学生向けのライブストリーミングイベント .NET Student Zone を行うという紹介。

.NET Student Zone では .NET に関することを学べるセッションが配信される。またそれに合わせて .NET Conf Student Zone Cloud Skills Challenge というチャレンジも開催され、参加者(学生)の中から3名に SWAG (景品) が当たるキャンペーンも実施される。

Performance improvements in ASP.NET Core 7 - .NET Blog

https://devblogs.microsoft.com/dotnet/performance-improvements-in-aspnet-core-7/

.NET 7 の ASP.NET Core のパフォーマンス改善についての解説記事。

ベンチマークと共に様々な性能向上について解説している。

  • サーバー全般
    • メモリープールパーティショニング
    • Windows の IO プールをマネージド実装を利用するよう切り替え
    • 接続クローズ時の例外の削減
    • PoolingAsyncValueTaskMethodBuilder の適用の拡大
  • HTTP/2
    • ロック競合の削減
    • デフォルトウィンドウサイズの拡大
  • HTTP/3
    • QPack 処理の改善
  • その他
    • SignalR
    • 認証
    • HttpResult
    • IndexOfAny
    • フィルター

.NET 7 Performance Improvements in .NET MAUI - .NET Blog

https://devblogs.microsoft.com/dotnet/dotnet-7-performance-improvements-in-dotnet-maui/

.NET 7 での .NET MAUI のパフォーマンス改善について解説記事。

起動時間とアプリケーションサイズ、スクロール時のパフォーマンスなどが改善されていることを掘り下げている。

  • スクロールとレイアウトのパフォーマンス改善
    • LOLs/秒
    • View.Context の繰り返し呼び出しを避ける
    • CollectionView 内での View.Context 呼び出しを避ける
    • レイアウト中の JNI 呼び出しを削減
    • RTL とダークモードの値をキャッシュする
    • レイアウト中の IView[] 生成を避ける
    • RTL レイアウト計算をプラットフォームにゆだねる
    • CollectionView のその他注意事項
  • 起動時のパフォーマンス改善
    • Android NDK コンパイラーフラグ
    • DateTimeOffset.Now
    • ColorStateList(int[][],int[]) を避ける
    • .NET MAUI の AOT プロファイルの改善
    • Java 相互運用でのより良い文字列比較
    • XAML コンパイルの改善
    • Windows 上での ReadyToRun のデフォルト有効化
    • macOS 上でのデュアルアーキテクチャーのデフォルト有効化
    • RegexOptions.Compiled についての注意
    • Mono のインタープリターの改善
  • アプリケーションサイズの改善
    • Android の DebuggerSupport トリマー値の修正
    • R8 Java Code Shrinker 改善
    • Kotlin 関連ファイルの除外機能
    • Generics の AOT 出力の改善
  • ツールとドキュメント
    • .NET MAUI アプリケーションのプロファイリング
    • 起動時間の計測
    • アプリケーションサイズのレポートツール
    • 試験的または高度な設定

Uno Platform 4.6: Hello .NET 7!

https://platform.uno/blog/uno-platform-4-6-hello-net-7/

Uno Platform 4.6 で .NET 7 に対応するというアナウンス。

記事では Uno Platform 4.6 での改善点として .NET 7 および Visual Studio 17.4 のサポート、ライブラリーリソース、SVG サポート、Android 13 サポート、WebAssembly Bootstrap 7.0、ASP.NET Core ホスティングプロジェクトについて紹介している。

Bring WCF apps to the latest .NET with CoreWCF and Upgrade Assistant - .NET Blog

https://devblogs.microsoft.com/dotnet/migration-wcf-to-corewcf-upgrade-assistant/

.NET Framework の WCF プロジェクトを CoreWCF へと移行するためのアップグレードアシスタントを紹介する記事。

記事ではサンプルプロジェクトを元に、ツールのインストールと実行、実行される移行処理についてを説明している。自動アップグレードで非サポートのものとして Web ベースや .svc ファイルを使用したサービス、XML を使用した動作構成、NetTcpBinding または HTTP ベース以外のバインディングといったものがあるとのこと。

Announcing .NET Community Toolkit v8.1.0 Preview 1 - .NET Blog

https://devblogs.microsoft.com/dotnet/announcing-dotnet-community-toolkit-v810-preview-1/

.NET Community Toolkit v8.1.0 Preview 1 のアナウンス。

MVVM Toolkit のソースジェネレーターで ObservableProperty に対するカスタム属性のサポートやソースジェネレーター自体の最適化、IObservable<T> メッセンジャー拡張、.NET 7 と C# 11 の対応 (Ref<T>, NullableRef<T> など)、その他様々な改善が含まれている。

.NET Interactive Notebooks is now Polyglot Notebooks! - .NET Blog

https://devblogs.microsoft.com/dotnet/dotnet-interactive-notebooks-is-now-polyglot-notebooks/

.NET Interactive Notebooks が Polyglot Notebooks に名称変更したというアナウンス。

Visual Studio Code 上で利用できる拡張である .NET Interactive Notebooks が Polyglot Notebooks に名称変更された。

.NET Interactive Notebooks は .NET 以外の言語のサポートが増えてきたことで名前が適切ではなくなってきたため、Polyglot Notebooks に名称変更することとなった。ただしエンジンは引き続き .NET Interactive であり、Visual Studio Code 拡張の名前が変更されただけであるとのこと。

アーティクル、スライドなど

neue cc - MemoryPackにみる .NET 7/C# 11世代のシリアライザー最適化技法

https://neue.cc/2022/11/04_memorypack.html

バイナリーシリアライザーの MemoryPack の実装を元に .NET 7 / C# 11 世代でのシリアライザーの最適化テクニックについて解説している記事。

SkiaSharp: Hatched fills with SKShader

https://bclehmann.github.io/2022/11/05/HatchingWithSKShader.html

SkiaSharp で SKShader を使用してハッチングの塗りつぶしを行う方法についての記事。

SkiaSharp: Unmasking with SKColorFilter

https://bclehmann.github.io/2022/11/06/UnmaskingWithSKColorFilter.html

SkiaSharp で SKColorFilter を使用して色を変更する方法についての記事。

Switch tenants in an ASP.NET Core app using Azure AD with multi tenants

https://damienbod.com/2022/10/31/switch-tenants-in-an-asp-net-core-app-using-azure-ad-with-multi-tenants/

Azure AD のマルチテナントアプリケーションとなる ASP.NET Core アプリケーションでテナントを切り替える方法についての記事。

C# .NETのVector classで条件分岐(if..then..else) - Qiita

https://qiita.com/C5D5E5/items/dd9da77e24752ff50cec

Vector を利用した際の条件分岐を行うための Vector.ConditionalSelect についての記事。

Dotnet (.NET) Performance Tracing for WinUI, Uno and Maui Applications - Nick's .NET Travels

https://nicksnettravels.builttoroam.com/dotnet-trace/

dotnet-trace と dotnet-dsrouter を使用して WinUI や Uno Platform, MAUI のアプリケーションのトレースを取得する方法についての記事。

Async Mutex | David’s Blog

https://dfederm.com/async-mutex/

Mutex をラップして async/await で利用できるようにする AsyncMutex を実装するという記事。

[C#]デバッグ時とかに欲しくなるbyte配列の16進ダンプ - Qiita

https://qiita.com/amutou/items/6a0954c7bf190127f3ef

od コマンドやバイナリエディターのような16進数ダンプを出力するコード。

C#の基本的な数値型同士の計算って何型になるんだっけ? - Qiita

https://qiita.com/full_deviation/items/a1e01871c33673fd66af

C# の数値型 (sbyte,byte,ushort,short,uint,int...) をそれぞれ組み合わせて計算したときに結果の型を調べたという記事。

Containerized Blazor: Microsoft Ponders New Client-Side Hosting -- Visual Studio Magazine

https://visualstudiomagazine.com/articles/2022/11/02/blazor-docker.aspx

Blazor WebAssembly をコンテナー化できるようにすることを検討している話についての記事。Blazor Server と異なり静的にビルドされ ASP.NET Core は不要となるため、手法として ASP.NET Core と同じ必要がない。

.NET Annotated Monthly | November 2022 | The .NET Tools Blog

https://blog.jetbrains.com/dotnet/2022/11/02/net-annotated-monthly-november-2022/

JetBrains による .NET 関連の情報まとめ 2022年11月号。

Visual Studio が Visual Studio を使って Visual Studio を構築する方法 - Microsoft Ignite - セッション カタログ

https://ignite.microsoft.com/ja-JP/sessions/bafdbcbc-f9e3-49ed-ac0b-fd1dd8cbc155?source=sessions

Visual Studio を開発しているチームが Visual Studio を開発するために行っていることについてのセッション。

Visual Studio のような超巨大なプロジェクトを効率的にビルドするための内部の仕組み、自動テストやパフォーマンスのトラッキングなど。

ライブラリ、リポジトリ、ツールなど

AutumnSky1010/SoundMaker: You can do The following content with this library and make the sound of chiptune export sound to a file of wave format.

https://github.com/AutumnSky1010/SoundMaker

チップチューン的な音楽を生成/出力するライブラリー。

tompazourek/NaturalSort.Extension: 🔀 Extension method for StringComparison that adds support for natural sorting (e.g. "abc1", "abc2", "abc10" instead of "abc1", "abc10", "abc2").

https://github.com/tompazourek/NaturalSort.Extension

エクスプローラーのファイル名のソートで使用されている自然順ソートを実現するための拡張ライブラリー。

devlooped/avatar: A modern compile-time generated interception/proxy library

https://github.com/devlooped/avatar

Source Generator を使用することでコンパイル時にプロキシーを生成するインターセプトライブラリー。 Source Generator を使用していることで IL の Emit (動的コード生成) が行えない環境でも動作することが特徴。

jinek/Consolonia: A cross-platform UI framework for .NET.

https://github.com/jinek/Consolonia

Avalonia UI のコンソール上での実装。

pierre3/PlantUmlClassDiagramGenerator: This is a generator to create a class-diagram of PlantUML from the C# source code.

https://github.com/pierre3/PlantUmlClassDiagramGenerator

C# のソースコードを元に PlantUML のクラス図を生成するツール。

ststeiger/PdfSharpCore: Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)

https://github.com/ststeiger/PdfSharpCore

PDF を生成するライブラリー。PdfSharp を .NET Core 向けに改修されたもの。

Deep Dive

Optimize XxHash3 by xoofx · Pull Request #77756 · dotnet/runtime

https://github.com/dotnet/runtime/pull/77756

XxHash3 を高速化したという PR。

Add XxHash128 by xoofx · Pull Request #77944 · dotnet/runtime

https://github.com/dotnet/runtime/pull/77944

XxHash128 の実装を追加する提案と PR