Click here to Skip to main content
15,887,267 members

The Insider News

   

The Insider News is for breaking IT and Software development news. Post your news, your alerts and your inside scoops. This is an IT news-only forum - all off-topic, non-news posts will be removed. If you wish to ask a programming question please post it here.

Get The Daily Insider direct to your mailbox every day. Subscribe now!

 
GeneralRe: Windows client roadmap update Pin
Joe Woodbury1-May-23 7:36
professionalJoe Woodbury1-May-23 7:36 
NewsThe C++ small string optimization Pin
Kent Sharkey30-Apr-23 10:31
staffKent Sharkey30-Apr-23 10:31 
GeneralRe: The C++ small string optimization Pin
Nelek30-Apr-23 11:30
protectorNelek30-Apr-23 11:30 
GeneralRe: The C++ small string optimization Pin
Kent Sharkey30-Apr-23 12:02
staffKent Sharkey30-Apr-23 12:02 
GeneralRe: The C++ small string optimization Pin
Nelek30-Apr-23 12:39
protectorNelek30-Apr-23 12:39 
GeneralRe: The C++ small string optimization Pin
Joe Woodbury1-May-23 7:41
professionalJoe Woodbury1-May-23 7:41 
GeneralRe: The C++ small string optimization Pin
Nelek1-May-23 10:35
protectorNelek1-May-23 10:35 
GeneralRe: The C++ small string optimization Pin
honey the codewitch1-May-23 7:04
mvahoney the codewitch1-May-23 7:04 
That's actually a good question, Ken. The article didn't cover it and presumably it's an implementation detail, but it would be one that would be good to know as a developer since it has so much different dynamics about it, by which I mean, SSO creates more locality and since it is not heap oriented, "short" strings can be stored contiguously in memory using std::vector. That's my takeaway.

But, here's the downside they didn't mention. It makes std::string stack heavy - unless there's some magic there I don't understand.

On IoT that's a problem, and looking at the asm output at godbolt.org for things like even declaring an iostream makes me shy well away from it there.

I've taken to rewriting a lot of the functionality in the STL in my C++ IoT applications because as The STL has evolved it has gotten less and less friendly to little processors like the ones I use daily.

Now, that's unfortunate, but I don't want it to be read as a criticism. An AllWinner H3 1Ghz quad core, running even 128MB of DDR3 will have no trouble with modern STL, and these ARM Cortex As are seemingly a big part of the future (and present) of small smart computing.

It's moving there. But the hardware at the IoT level isn't quite up to the software. It's being sorely outpaced at the bottom end.

For perspective, let me put it in US dollars

A Sunxi AllWinner H3 SoC with a quadcore 1GHz ARM Cortex A53 CPU+ Mali GPU, and 128MB with DDR3 can be had in terms of components (sans supporting capacitors, power supply, and stuff - just SoC, RAM and eMMC) for $13-$18/per depending on which parts you source stateside (some you have to get out of Asia)

An Espressif ESP32S3 with "SoC" with a dual core 240MHz CPU (no GPU) but with 512kB embedded SRAM and 8MB of PSRAM, + 16MB of internal flash storage (requiring no external memory or flash) can be had for $4.31/per stateside. And this is a very capable chip as IoT class stuff goes. I don't count the RPi among this class.

The ESP32S3 and chips like it are the little IoT widget class chips, and they don't run the STL very well.

The std::string optimization seems like it makes a bad situation worse in some respects, in terms of stack bloat. You often don't have dynamically growable stacks or even much room on the stack to begin with. printf is bad enough. You start throwing a bunch of std::strings at it and pretty soon you're in real trouble.
To err is human. Fortune favors the monsters.

NewsHackers take control of government-owned satellite in alarming experiment Pin
Kent Sharkey30-Apr-23 10:31
staffKent Sharkey30-Apr-23 10:31 
GeneralRe: Hackers take control of government-owned satellite in alarming experiment Pin
Nelek30-Apr-23 11:29
protectorNelek30-Apr-23 11:29 
NewsWhat Is the state of the Java ecosystem in 2023? Pin
Kent Sharkey30-Apr-23 10:31
staffKent Sharkey30-Apr-23 10:31 
GeneralRe: What Is the state of the Java ecosystem in 2023? Pin
Nelek30-Apr-23 11:28
protectorNelek30-Apr-23 11:28 
GeneralRe: What Is the state of the Java ecosystem in 2023? Pin
Kent Sharkey30-Apr-23 12:03
staffKent Sharkey30-Apr-23 12:03 
GeneralRe: What Is the state of the Java ecosystem in 2023? Pin
Dan Neely1-May-23 3:53
Dan Neely1-May-23 3:53 
NewsTimber! The world’s first wooden transistor Pin
Kent Sharkey30-Apr-23 10:31
staffKent Sharkey30-Apr-23 10:31 
GeneralRe: Timber! The world’s first wooden transistor Pin
Nelek30-Apr-23 11:28
protectorNelek30-Apr-23 11:28 
JokeRe: Timber! The world’s first wooden transistor Pin
Daniel Pfeffer30-Apr-23 19:44
professionalDaniel Pfeffer30-Apr-23 19:44 
GeneralRe: Timber! The world’s first wooden transistor Pin
MarkTJohnson1-May-23 3:14
professionalMarkTJohnson1-May-23 3:14 
NewsMajority of organizations report benefits from low-code platforms Pin
Kent Sharkey30-Apr-23 10:31
staffKent Sharkey30-Apr-23 10:31 
GeneralRe: Majority of organizations report benefits from low-code platforms Pin
Nelek30-Apr-23 11:26
protectorNelek30-Apr-23 11:26 
NewsVisual Studio IntelliCode AI assistant gets deep learning upgrade Pin
Kent Sharkey30-Apr-23 10:31
staffKent Sharkey30-Apr-23 10:31 
News30 years ago this month, the Mosaic web browser officially launched and changed the world Pin
Kent Sharkey30-Apr-23 10:31
staffKent Sharkey30-Apr-23 10:31 
GeneralRe: 30 years ago this month, the Mosaic web browser officially launched and changed the world Pin
Nelek30-Apr-23 11:23
protectorNelek30-Apr-23 11:23 
NewsMicrosoft is busy rewriting core Windows code in memory-safe Rust Pin
Kent Sharkey30-Apr-23 10:31
staffKent Sharkey30-Apr-23 10:31 
GeneralRe: Microsoft is busy rewriting core Windows code in memory-safe Rust Pin
Nelek30-Apr-23 11:22
protectorNelek30-Apr-23 11:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.