Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Conversation

@Executor-Cheng
Copy link
Owner

close #2
先实现MiraiCodeReader
定义为ref struct, 暂将处理方法定义为Parse(NameHandler, ArgumentHandler)

将来考虑的:

  • 添加特定的Exceptions
  • 添加MiraiCodeWriter

性能测试结果:

BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19042
Intel Core i9-10900KF CPU 4.90GHz, 1 CPU, 20 logical and 10 physical cores
.NET Core SDK=5.0.201
  [Host]     : .NET Core 5.0.4 (CoreCLR 5.0.421.11614, CoreFX 5.0.421.11614), X64 RyuJIT
  DefaultJob : .NET Core 5.0.4 (CoreCLR 5.0.421.11614, CoreFX 5.0.421.11614), X64 RyuJIT
Method input Mean Error StdDev
Parse [mir(...)n"}] [719] 327.70 ns 0.727 ns 0.607 ns
Parse [mirai:at:123456789] 30.78 ns 0.083 ns 0.078 ns
Parse [mirai:atall] 24.31 ns 0.075 ns 0.070 ns
Parse [mira(...)61]] [39] 37.89 ns 0.079 ns 0.066 ns

测试语句是new MiraiCodeReader(input).Parse(static _ => { }, static _ => { });

参考: mirai码规范

@Executor-Cheng Executor-Cheng added the pending The developer is working on other projects. label May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

pending The developer is working on other projects.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants