Skip to content

docs: update CopyElement benchmark walkthrough to reflect current implementation#527

Closed
Ganesh-reddy005 wants to merge 2 commits intogoatshriek:latestfrom
Ganesh-reddy005:latest
Closed

docs: update CopyElement benchmark walkthrough to reflect current implementation#527
Ganesh-reddy005 wants to merge 2 commits intogoatshriek:latestfrom
Ganesh-reddy005:latest

Conversation

@Ganesh-reddy005
Copy link

This PR updates the documentation snippet in docs/benchmark.md under the "Walkthrough: Improving stumpless_copy_element" section. The previous snippet showed an outdated manual param-copying approach. This update replaces it with the current implementation from test/performance/element.cpp, which uses stumpless_copy_element() directly.

This improves clarity and ensures the documentation accurately reflects the benchmark code used today.

Fixes #444

@goatshriek goatshriek added the documentation documentation updates label Sep 30, 2025
@goatshriek goatshriek self-assigned this Sep 30, 2025
@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.82%. Comparing base (844641e) to head (22de385).

Additional details and impacted files
@@           Coverage Diff           @@
##           latest     #527   +/-   ##
=======================================
  Coverage   90.82%   90.82%           
=======================================
  Files          47       47           
  Lines        4576     4576           
  Branches      609      609           
=======================================
  Hits         4156     4156           
  Misses        276      276           
  Partials      144      144           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Owner

@goatshriek goatshriek left a comment

Choose a reason for hiding this comment

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

Please take another look at this - you've replaced the code that was being tested, instead of the benchmark code as the original issue describes.

```c
// first create a new element
copy = stumpless_new_element( stumpless_get_element_name( element ) );
static void CopyElement(benchmark::State& state){
Copy link
Owner

Choose a reason for hiding this comment

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

You've replaced the wrong code snippet - please leave the example C code, and replace the benchmark code instead (starting on line 65 in the original file).

Copy link
Owner

@goatshriek goatshriek left a comment

Choose a reason for hiding this comment

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

Please address the previous review's comment.

@goatshriek
Copy link
Owner

This change has been covered by #549.

@goatshriek goatshriek closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation documentation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update benchmark documentation to match code

2 participants