This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Code compiled by SEGGER is faster than one compiled with just GCC

Hi,

(nRF52840)

I have project made in SEGGER Embedded Studio with OPUS Encoder (optimized by Nordic). It's CELT, bitrate 40000 and complexity 5. This is configuration of the optimization and debug:

On project made in SEGGER, this configuration works fine.

Although, when I use the same OPUS Encoder in Makefile and compiled by GCC (args: -O3 -g2 -flto), the complexity 5 is too much and needs to be switched to 4.

I can't get it, because SEGGER uses the GCC too, and the level of debug and optimization is same, so it doesn't giving any sense to me.

What can be issue for this? Please, note that project which uses Makefile is a bit different, so maybe this project is missing some clock configuration or something?
(NOTE: Even both projects are different, both of them just doing only thing, encode, nothing else is being made, so the tests are the same)

Thank you,
with Regards,
Marek Kraus

Parents
  • Hello Marek,

    They both use GCC for compiling and linking, but Segger provides their own runtime libraries: https://www.segger.com/products/development-tools/runtime-library/. Could that be the reason maybe? You may try to change the library settings in Segger to see if it impacts the performance for your test:

    Best regards,

    Vidar

  • Dear Vidar,
    Thank you for fast reply.
    By default, it has been configured as "Embedded Studio", and there is only "SEGGER" option, not possible to specify custom runtime lib as nanolib.

    Do you think this can be that big difference? Only differences I think it could have is that Segger's runtime library have optimized memcpy and memset function (and few other subset of functions which are used by OPUS), which would make encoding faster, but that more faster it can handle complexity 5? Any other ideas where should be an issue? Please note, that our makefile project is based on blinky makefile, I'm not sure on how much the MCU is initialized in this blinky project.

    Thank you for your time.

  • Dear Marek,

    I don't know how much of a difference you can expect between these libraries, but this was the only explanation I could think of.

    My idea was that you could try the size optimized version of the Segger library (i.e. set the library optmization to "small") to see if it would impact the performance, not that you should try to link in nanolib in the SES project. Another thing you can try is to use newlib in your makefile project by commenting this line in your Makefile:

    # use newlib in nano version
    #LDFLAGS += --specs=nano.specs

Reply
  • Dear Marek,

    I don't know how much of a difference you can expect between these libraries, but this was the only explanation I could think of.

    My idea was that you could try the size optimized version of the Segger library (i.e. set the library optmization to "small") to see if it would impact the performance, not that you should try to link in nanolib in the SES project. Another thing you can try is to use newlib in your makefile project by commenting this line in your Makefile:

    # use newlib in nano version
    #LDFLAGS += --specs=nano.specs

Children
No Data
Related