Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实现MiraiCode #47

Draft
wants to merge 1 commit into
base: preview/1.0.2.2
Choose a base branch
from
Draft

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending The developer is working on other projects.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant