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

tests(filter): add some benchmark for index match #838

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

msaf1980
Copy link
Member

@msaf1980 msaf1980 commented Mar 2, 2023

Some benchmark for check filter match perfomance

@msaf1980 msaf1980 requested a review from a team as a code owner March 2, 2023 11:53
@@ -61,3 +61,55 @@ func TestPatternIndex(t *testing.T) {
}
})
}

func BenchmarkPatternIndex(b *testing.B) {
Copy link
Member

Choose a reason for hiding this comment

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

мб это перетащить лучше в perfomance_tests/filter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Там более высокоуровневые тесты, вот и не стал складывать туда. Это скорее бенчмарк самих хранилищ. Но можно и туда, если считаешь. Другой вопрос, надо ли эти тесты вам ? Собственно зачем они.

Я тут делаю подобную библиотечку для матчинга у себя. Вот и хотел для сравнения. Результаты пока интересные - реализация с префиксными деревьями похожа по производительности на реализацию в Мойре. А реализация без (с индивидуальной проверкой по каждому правилу) оказалась ощутимо быстрее - в 3,5 раза примерно. Подтяну еще может тесты из perofmance_tests/filter. Пусть PR пока повесит - вызреет.

Copy link
Member

Choose a reason for hiding this comment

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

помечу пр как драфт тогда пока

Copy link
Member

Choose a reason for hiding this comment

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

реализация с префиксными деревьями похожа по производительности на реализацию в Мойре - в мойре же как раз префиксное дерево :)

@kissken kissken marked this pull request as draft March 3, 2023 05:33
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