From 11a15bfa64f0fcb8f1b85477821ba4708c3c9bdb Mon Sep 17 00:00:00 2001 From: Loretta Date: Sat, 7 Mar 2026 20:50:32 +0100 Subject: [PATCH] Update serializer defaults and add MemoryPack fetch scripts Changed default WireMode to Compact and string interning to Attribute in AcBinarySerializerOptions. Added Bash commands in settings.local.json for fetching and processing Cysharp/MemoryPack files via GitHub API and curl/python scripts. --- .claude/settings.local.json | 9 ++++++++- .../Serializers/Binaries/AcBinarySerializerOptions.cs | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 2b08fdb..4cf40ad 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -37,7 +37,14 @@ "Bash(sort:*)", "WebFetch(domain:neuecc.medium.com)", "WebFetch(domain:raw.githubusercontent.com)", - "Bash(xargs cat)" + "Bash(xargs cat)", + "Bash(curl -s -H \"Accept: application/vnd.github.v3+json\" \"https://api.github.com/repos/Cysharp/MemoryPack/git/trees/main?recursive=1\")", + "Bash(python3 -c \" import sys, json data = json.load\\(sys.stdin\\) for item in data.get\\(''tree'', []\\): path = item[''path''] if ''nion'' in path.lower\\(\\) or ''Emitter'' in path or ''Generator'' in path.split\\(''/''\\)[-1] if ''/'' in path else False: print\\(path\\) \")", + "Bash(python -c \" import sys, json data = json.load\\(sys.stdin\\) for item in data.get\\(''tree'', []\\): p = item[''path''] pl = p.lower\\(\\) if ''union'' in pl or ''emitter'' in pl or \\(p.startswith\\(''src/MemoryPack.Generator/''\\) and p.endswith\\(''.cs''\\)\\): print\\(p\\) \")", + "Bash(curl -s \"https://api.github.com/repos/Cysharp/MemoryPack/git/trees/main?recursive=1\")", + "Bash(curl -sL \"https://raw.githubusercontent.com/Cysharp/MemoryPack/main/src/MemoryPack.Generator/MemoryPackGenerator.Emitter.cs\")", + "Bash(curl -sL \"https://raw.githubusercontent.com/Cysharp/MemoryPack/main/src/MemoryPack.Core/MemoryPackCode.cs\")", + "Bash(curl -sL \"https://raw.githubusercontent.com/Cysharp/MemoryPack/main/src/MemoryPack.Generator/MemoryPackGenerator.Parser.cs\")" ] } } diff --git a/AyCode.Core/Serializers/Binaries/AcBinarySerializerOptions.cs b/AyCode.Core/Serializers/Binaries/AcBinarySerializerOptions.cs index dc76c95..e725a7e 100644 --- a/AyCode.Core/Serializers/Binaries/AcBinarySerializerOptions.cs +++ b/AyCode.Core/Serializers/Binaries/AcBinarySerializerOptions.cs @@ -90,7 +90,7 @@ public sealed class AcBinarySerializerOptions : AcSerializerOptions /// Compact: VarInt + UTF-8 (default, smaller output). /// Fast: Fixed-width integers + UTF-16 (larger output, faster encode/decode). /// - public WireMode WireMode { get; set; } = WireMode.Fast; + public WireMode WireMode { get; set; } = WireMode.Compact; /// /// Controls how string interning is applied during serialization. @@ -99,7 +99,7 @@ public sealed class AcBinarySerializerOptions : AcSerializerOptions /// All: All strings within length limits are interned (legacy behavior). /// Default: All /// - public StringInterningMode UseStringInterning { get; set; } = StringInterningMode.All; + public StringInterningMode UseStringInterning { get; set; } = StringInterningMode.Attribute; /// /// When true, checks for duplicate property name hashes during serialization (UseMetadata mode).