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

[WebServer] Mark functions as const + reduce copy of strings #10339

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

TD-er
Copy link
Contributor

@TD-er TD-er commented Sep 12, 2024

Description of Change

A few functions in WebServer does have String arguments, which does lead to copying of the strings when calling those functions.
For those where applicable, I changed the function arguments to const String&.

Also some functions which do not modify members, were not marked as const. Added those too.

Copy link
Contributor

github-actions bot commented Sep 12, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "[WebServer] Mark functions as const + reduce copy of strings":
    • summary looks empty
    • type/action looks empty

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

👋 Hello TD-er, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 161434f

Copy link
Contributor

github-actions bot commented Sep 12, 2024

Test Results

 56 files   -  83   56 suites   - 83   4m 57s ⏱️ - 1h 37m 48s
 21 tests  -   9   21 ✅  -   9  0 💤 ±0  0 ❌ ±0 
135 runs   - 168  135 ✅  - 168  0 💤 ±0  0 ❌ ±0 

Results for commit 161434f. ± Comparison against base commit 4e9eb35.

This pull request removes 9 tests.
performance.coremark.test_coremark ‑ test_coremark
performance.fibonacci.test_fibonacci ‑ test_fibonacci
performance.psramspeed.test_psramspeed ‑ test_psramspeed
performance.ramspeed.test_ramspeed ‑ test_ramspeed
performance.superpi.test_superpi ‑ test_superpi
test_touch_errors
test_touch_interrtupt
test_touch_read
validation.periman.test_periman ‑ test_periman

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Sep 12, 2024

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32S3💚 -8280💚 -0.080.00000.000.00
ESP32S2💚 -8440💚 -0.090.00000.000.00
ESP32C3💚 -5560💚 -0.050.00000.000.00
ESP32C6💚 -5560💚 -0.050.00000.000.00
ESP32💚 -8320💚 -0.080.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32S3ESP32S2ESP32C3ESP32C6ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
WebServer/examples/AdvancedWebServer💚 -6560💚 -6480💚 -3680💚 -3680💚 -6360
WebServer/examples/FSBrowser💚 -6880💚 -7120💚 -3820💚 -3820💚 -6840
WebServer/examples/Filters💚 -6480💚 -6400💚 -3680💚 -3680💚 -6480
WebServer/examples/HelloServer💚 -6320💚 -6480💚 -3680💚 -3680💚 -6520
WebServer/examples/HttpAdvancedAuth💚 -6760💚 -7120💚 -3820💚 -3920💚 -6720
WebServer/examples/HttpAuthCallback💚 -6520💚 -6880💚 -4020💚 -3940💚 -6720
WebServer/examples/HttpAuthCallbackInline💚 -6600💚 -7240💚 -4000💚 -3920💚 -6720
WebServer/examples/HttpBasicAuth💚 -6720💚 -7120💚 -3980💚 -3900💚 -6720
WebServer/examples/HttpBasicAuthSHA1💚 -6720💚 -6800💚 -3940💚 -3860💚 -6680
WebServer/examples/HttpBasicAuthSHA1orBearerToken💚 -6400💚 -6720💚 -3980💚 -3880💚 -6800
WebServer/examples/MultiHomedServers💚 -6480💚 -6320💚 -3680💚 -3680💚 -6360
WebServer/examples/PathArgServer💚 -6600💚 -6800💚 -3600💚 -3600💚 -6440
WebServer/examples/SDWebServer💚 -6720💚 -7240💚 -3880💚 -3880💚 -6840
WebServer/examples/SimpleAuthentification💚 -6400💚 -6480💚 -3680💚 -3680💚 -6320
WebServer/examples/UploadHugeFile💚 -7160💚 -7720💚 -4560💚 -4400💚 -7120
WebServer/examples/WebServer💚 -8280💚 -8440💚 -5560💚 -5560💚 -8320
WebServer/examples/WebUpdate💚 -6200💚 -6160💚 -3080💚 -2980💚 -6040

@TD-er TD-er marked this pull request as ready for review September 12, 2024 20:40
@P-R-O-C-H-Y P-R-O-C-H-Y added Area: Libraries Issue is related to Library support. Status: Pending Merge Pull Request is ready to be merged labels Sep 13, 2024
@me-no-dev me-no-dev merged commit 9e60bbe into espressif:master Sep 13, 2024
54 checks passed
@TD-er
Copy link
Contributor Author

TD-er commented Sep 13, 2024

Wow, quick merges :)

@TD-er TD-er deleted the webserver_reduce_string_copy branch September 13, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Libraries Issue is related to Library support. Status: Pending Merge Pull Request is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants