ayushsharma82 / ESP-DASH

Blazing fast library to create a functional, on-device dashboard for ESP8266 / ESP32 / RP2040
https://espdash.pro
GNU General Public License v3.0
978 stars 200 forks source link

Several improvements: Support move semantic + remove vector in favour of std one + add support for std::string with -D DASH_USE_STL_STRING=1 #245

Open mathieucarbou opened 2 weeks ago

mathieucarbou commented 2 weeks ago

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.

3) add support for std::string with -D DASH_USE_STL_STRING=1

github-actions[bot] commented 2 weeks ago

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

mathieucarbou commented 2 weeks ago

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

mathieucarbou commented 1 week ago

@ayushsharma82 : FYI.

I also have the same commits for the pro version in my dev branch.

I refreshed them just now (minor cleanups) and rebased.

ayushsharma82 commented 6 days ago

Thanks @mathieucarbou , I'll merge everything in upcoming days.