Skip to content

Conversation

@liyafan82
Copy link
Contributor

For the past days, we have been involved in some performance related issues. In this process, we have created some performance benchmarks, to help us verify performance results.

Now we want to add such micro-benchmarks to the code base, in the hope that they will be helpful for making performance-related decisions and avoid performance degradation.

@emkornfield
Copy link
Contributor

@liyafan82 thank you for doing this. Is there a reason you chose to create a new module instead of adding the benchmarks to the existing sub-projects (memory and vector)?

@liyafan82
Copy link
Contributor Author

liyafan82 commented May 31, 2019

@liyafan82 thank you for doing this. Is there a reason you chose to create a new module instead of adding the benchmarks to the existing sub-projects (memory and vector)?

Good question.

To get reliable and reproducible performance results, JMH is the preferred benchmark framework (as recommended by Jacques Nadeau). And creating a standalone project is the recommended way of doing this. Please see https://openjdk.java.net/projects/code-tools/jmh/

image

Copy link
Contributor

@emkornfield emkornfield left a comment

Choose a reason for hiding this comment

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

@liyafan82 can the benchmarks be placed under test instead of main?

Also would it make sense to put them in the same package as the classes they are testing, I think that would make them more discoverable?

}

/**
* Test reading/writing on {@link Float8Vector}.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you give pointers here to the memory bounds check and null check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revised accordingly. Thanks for your good suggestion.

@liyafan82
Copy link
Contributor Author

@liyafan82 can the benchmarks be placed under test instead of main?

Also would it make sense to put them in the same package as the classes they are testing, I think that would make them more discoverable?

I have moved them to the same packages as their related classes. Thanks for the good suggestion.

In addition, I have also placed them as test cases in the test directory. However, I am not sure if this is exactly what you want, since benchmark evaluating can be time consuming. Do you want these benchmarks to be moved to the test directory, and still evaluated by the main method?

@emkornfield
Copy link
Contributor

Thanks. +1, LGTM

@emkornfield
Copy link
Contributor

(test failure appears unrelated)

pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
For the past days, we have been involved in some performance related issues. In this process, we have created some performance benchmarks, to help us verify performance results.

Now we want to add such micro-benchmarks to the code base, in the hope that they will be helpful for making performance-related decisions and avoid performance degradation.

Author: liyafan82 <fan_li_ya@foxmail.com>

Closes apache#4430 from liyafan82/fly_0531_benchmark and squashes the following commits:

fde0e0a <liyafan82>  Move benchmarks to tests
e734b40 <liyafan82>  Add micro-benchmarks for Float8Vector and allocators
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