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

ndpi_strnstr optimization #2433

Merged
merged 3 commits into from
May 10, 2024
Merged

ndpi_strnstr optimization #2433

merged 3 commits into from
May 10, 2024

Conversation

0xA50C1A1
Copy link
Contributor

Please sign (check) the below before submitting the Pull Request:

Describe changes:

On average, the new implementation is 2.5 times faster. Although, of course, there are test cases where it shows slightly worse results.

Also I wrote a small benchmark to compare different implementations if you're interested.

@0xA50C1A1 0xA50C1A1 marked this pull request as ready for review May 10, 2024 08:15
Copy link
Collaborator

@IvanNardi IvanNardi left a comment

Choose a reason for hiding this comment

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

Could you

  • add the benchmark code in tests/performance/, updating the makefile, please?
  • add some unit tests (expecially, some corner cases) in example/ndpiReader.c, like you did for strlcpy?

@0xA50C1A1
Copy link
Contributor Author

Could you

* add the benchmark code in `tests/performance/`, updating the makefile, please?

original one or try to rewrite it in C?

@IvanNardi
Copy link
Collaborator

original one or try to rewrite it in C?

Original one!

@0xA50C1A1
Copy link
Contributor Author

original one or try to rewrite it in C?

Original one!

Ok, sure.

Copy link

sonarcloud bot commented May 10, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@0xA50C1A1 0xA50C1A1 requested a review from IvanNardi May 10, 2024 12:06
Copy link
Collaborator

@IvanNardi IvanNardi left a comment

Choose a reason for hiding this comment

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

Thanks!

@IvanNardi IvanNardi merged commit a813121 into ntop:dev May 10, 2024
33 checks passed
@0xA50C1A1 0xA50C1A1 deleted the improve_strnstr branch May 10, 2024 20:51
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.

None yet

2 participants