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

Optimise FlashString iteration and indexing #2761

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Apr 10, 2024

This PR improves performance of FlashString library object iteration and indexing.

mikee47 added 2 commits April 10, 2024 12:36
Got parameters reversed in FlashSring test code.

This isn't a problem for `memcmp_P` implementation in `Sming/Arch/Esp8266/Components/libc/src/oldlib/pgmspace.c` as it consider both parameters pointers to flash:

```
int memcmp_P(PGM_VOID_P a1, PGM_VOID_P b1, size_t len);
```

But the version in newlib (provided by esp-quick-toolchain) is:

```
int memcmp_P(const void* buf1, PGM_VOID_P buf2_P, size_t len);
```

This is the de-facto standard form used by Arduino, etc.
Imroves iterator and lookup speeds. New tests added.
Copy link

what-the-diff bot commented Apr 10, 2024

PR Summary

  • Expanded Program Memory Support
    Aided support for program memory in the 'pgmspace.h' file across multiple platforms such as Esp32, Esp8266, Host, and Rp2040. This enhancement aids the software in handling and storing data more efficiently across a variety of hardware platforms.

  • Improved Function Interfaces
    Updated the structure of various software functions to either expand capabilities or streamline behavior. This results in code that's easier to maintain and more flexible for future updates.

  • Enhanced Memory & String Manipulation Functions
    The 'src' parameter has been replaced with 'src_P' in several memory and string manipulation functions, optimizing the way these functions handle information. This improves the efficiency of data management within the software while minimizing potential errors.

@slaff slaff added this to the 5.2.0 milestone Apr 10, 2024
@slaff slaff merged commit 040d6bd into SmingHub:develop Apr 12, 2024
45 of 46 checks passed
@mikee47 mikee47 deleted the feature/FlashString-optimise branch April 12, 2024 11:54
@slaff slaff mentioned this pull request May 8, 2024
5 tasks
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