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

Бочаров Александр #246

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

Geratoptus
Copy link

No description provided.

- Убрал ненужные классы
- В сравнении добавил каст к (double), теперь проверка корректная
- Добавил GC.Collect() перед замером времени для более корректной проверки

Enumerable.Range(1, results.Count - 1)
.Select(i => results[i].Ticks / results[i - 1].Ticks)
.Should().OnlyContain(timeRatio => timeRatio < scale * scale);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Может будем сравнивать с меньшей асимптотичной сложностью?
O(n^2) выглядит много

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

cs/MarkdownTests/Parser/Rules/ItalicRuleTest.cs Outdated Show resolved Hide resolved
cs/MarkdownTests/MdAcceptanceTest.cs Show resolved Hide resolved
cs/Markdown/Parser/Rules/InWordBoldRule.cs Outdated Show resolved Hide resolved
… переданных параметров вынес в статические поля
{
var begin = 0;
var tokenList = new List<Token>();
var memoryText = new Memory<char>(text.ToCharArray());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://learn.microsoft.com/en-us/dotnet/api/system.memoryextensions.asmemory?view=net-9.0

Чтобы избежать аллокации дополнительных O(text) памяти

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants