WString: Optimize a bit by jjsuwa · Pull Request #7553 · esp8266/Arduino

earlephilhower

requested changes Aug 28, 2020

devyte

TD-er

TD-er

devyte

devyte

devyte

jjsuwa added a commit to jjsuwa/Arduino that referenced this pull request

Sep 10, 2020

@jjsuwa

TD-er

TD-er

@mcspr mcspr mentioned this pull request

Sep 25, 2020

earlephilhower

mcspr added a commit to mcspr/esp8266-Arduino that referenced this pull request

Sep 27, 2020
based on the esp8266#7553 without isSSO -> isHeap rename and inline optimizations
additionally, remove useless pre-c++11 preprocessor checks

Co-authored-by: Takayuki 'January June' Suwa <jjsuwa@sys3175.com>

earlephilhower pushed a commit that referenced this pull request

Sep 27, 2020
* (test) WString: c_str() returns null pointer

target = std::move(source) does not reset buffer pointer back to the sso

* wstring: correctly do move invalidation & copy

based on the #7553 without isSSO -> isHeap rename and inline optimizations
additionally, remove useless pre-c++11 preprocessor checks

Co-authored-by: Takayuki 'January June' Suwa <jjsuwa@sys3175.com>

dirkmueller

Jason2866 referenced this pull request in arendst/Tasmota

Oct 22, 2020
Tasmota Arduino Core v2.7.4.5 allowing webpassword over 47 characters (#9687)

earlephilhower

d-a-v

earlephilhower

@mcspr mcspr mentioned this pull request

Nov 9, 2020

1 task

@jjsuwa-sys3175

* move bodies of dtor, `init()` and `charAt()` to .h (implicitly inlined)

* unify descriptions of the initialization into one: `init()` (literally), that is called from each ctors, `invalidate()` and `move()`

* invert the SSO state logic in order to make init state zeroed (as a result, each inlined `init()` saves 1 insn)

* detab and trim

* remove `inline` from .h

* cosmetics

* optimize the non-SSO -> SSO transition part of `changeBuffer()`

* remove duped body of `operator =(StringSumHelper &&rval)`

* remove common subexpressions from `lastIndexOf()` and `substring()`

* eliminate `strlen(buf)` after calling `sprintf(buf, ...)` that returns # of chars written

* eliminate `len()` after calling `setLen(newlen)`

* make ctor`(char c)` inlineable

* optimize `setLen()`

* replace constant-forwarding overload functions with default argument ones

* optimize `concat(char c)`

IROM size @ FSBrowser: 304916 -> 304372 (saved 544 from master)

earlephilhower

@jjsuwa-sys3175

IROM size @ FSBrowser: 304372 -> 304356 (saved 560 from master)

TD-er

@jjsuwa-sys3175

@d-a-v

@jjsuwa jjsuwa deleted the WString_cutWaste branch

November 16, 2020 14:43

@mcspr mcspr mentioned this pull request

Nov 18, 2020