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

Several improvements: Support move semantic + remove vector in favour of std one + add support for STL string #245

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

mathieucarbou
Copy link
Contributor

@mathieucarbou mathieucarbou commented Nov 14, 2024

Several improvements in this PR:

1) using std::vector instead of current vector class

2)Support for move semantic for strings to avoid a buffer copy for rvalues

Move semantic allows to avoid a second buffer copy when calling ESP-DASH with rvalues like that:

card.update(String("Hello") + " World!");
card.update(WiFI.localIP().toString());

The created buffer will directly be transferred to the internal class, which reduces heap fragmentation.

These update() calls being frequently called so this is a relevant optimizaiton.

2) Add support for STL std::string in ESP-DASH with -D DASH_USE_STL_STRING=1

Copy link
Contributor

github-actions bot commented Nov 14, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@mathieucarbou
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@mathieucarbou mathieucarbou marked this pull request as draft November 14, 2024 20:44
@mathieucarbou mathieucarbou changed the title Support move semantic and removed vector implementation in favour of std one Several improvements: Support move semantic + remove vector in favour of std one + add support for STL string Nov 14, 2024
@mathieucarbou mathieucarbou marked this pull request as ready for review November 14, 2024 20:48
@mathieucarbou
Copy link
Contributor Author

mathieucarbou commented Nov 14, 2024

@ayushsharma82 : FYI.

I am currently applying the same changes in the pro version in my dev branch.

This PR is used and tested in:

With -D DASH_USE_STL_STRING=1

I also tested that -D DASH_USE_LEGACY_CHART_STORAGE=1 works, but I wonder if keeping this backward compatibility stuff is needed at all....

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.

1 participant