Feature/improve perf#69
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces performance improvements along with additional tests and benchmarks for the EventLoop module, and refactors a couple of math utilities and API signatures for consistency.
- Added comprehensive tests and benchmarking for the EventLoop in tests/event_loop/event_loop.cpp.
- Introduced a fast, inlined absolute value implementation in include/nodec/math/math.hpp and updated its usage in include/nodec/gfx/frustum.hpp.
- Updated the ArrayView constructor in include/nodec/array_view.hpp for consistent pointer type.
- Provided complete implementation of an asynchronous EventLoop in include/nodec/event_loop.hpp.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/event_loop/event_loop.cpp | Added test cases and benchmarks for the EventLoop functionality. |
| include/nodec/math/math.hpp | Added a fast, inline abs() function and updated approx_equal accordingly. |
| include/nodec/gfx/frustum.hpp | Switched to using math::abs for consistency in numeric operations. |
| include/nodec/event_loop.hpp | Provided a complete EventLoop implementation with scheduling and waiting logic. |
| include/nodec/array_view.hpp | Fixed the ArrayView constructor signature to use the correct pointer type. |
Files not reviewed (1)
- tests/CMakeLists.txt: Language not supported
Comments suppressed due to low confidence (1)
include/nodec/array_view.hpp:50
- [nitpick] Consider confirming that the change from 'pointer *first' to 'pointer first' aligns with the intended API usage and all consumers of ArrayView are updated accordingly.
ArrayView(pointer first, std::size_t size) noexcept
| while (wait_for_events(max_wait)) { | ||
| spin_once(); | ||
| } | ||
| return; |
There was a problem hiding this comment.
[nitpick] The explicit 'return;' at the end of the spin() function is superfluous and can be removed to improve code clarity.
Suggested change
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.