Choosing flag in bottleneck function: bool or int?

RichPiano
Posts: 123
Joined: Mon May 18, 2020 2:51 pm

Choosing flag in bottleneck function: bool or int?

Postby RichPiano » Sat Nov 27, 2021 5:06 pm

I have very hot code that I want to optimize as far as possible. If I have the choice between bool or int flags, what should I choose when coding with C++ for the xtensa-compiler?

https://stackoverflow.com/questions/576 ... l-or-ifint

Victoria Nope
Posts: 75
Joined: Fri Dec 04, 2020 9:56 pm

Re: Choosing flag in bottleneck function: bool or int?

Postby Victoria Nope » Sun Nov 28, 2021 2:17 pm

Not an answer, but a note; you may get disassembly by yourself. Because so long you really want the best optimization for your code, you should consult generated assembler code anyway.

RichPiano
Posts: 123
Joined: Mon May 18, 2020 2:51 pm

Re: Choosing flag in bottleneck function: bool or int?

Postby RichPiano » Mon Dec 13, 2021 6:54 am

Thanks for your hint. I'm a bit of a noob in looking at assembler code. How do I do that for the xtensa compiler? I know I can use godbolt for all desktop compilers, but for the extensa one I would have to look into the obj files?

Victoria Nope
Posts: 75
Joined: Fri Dec 04, 2020 9:56 pm

Re: Choosing flag in bottleneck function: bool or int?

Postby Victoria Nope » Mon Dec 13, 2021 11:41 am

Coincidentally, how to get ESP32 binary disassembly was one of my first questions in this thread.

Who is online

Users browsing this forum: Bing [Bot], MicroController and 182 guests