This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EK-TM4C1294XL: Classes-Methods or C functions are more efficient for the same job?

Part Number: EK-TM4C1294XL
Other Parts Discussed in Thread: TM4C1294NCPDT

Hello. It would be very helpful to know if some test/bench-marking firmware source routines exist, that could be loaded on a dev-board like EK-TM4C129XL, and perform let's say a series of calculations and/or GPIO operations using a) Classes and Method instantiations b) C functions and calls, but both a & b are doing/imlement  100% exactly the same operations. I need to measure/benchmark which approach is faster and/or more efficient in terms of not only speed but also of memory usage. The C++/classes approach or the C functions approach would be better? Both will be running on the bare-bone silicon without any RTOS in the middle. Thank you very much, John

  • Hello John

    EEMBC CoreMark suite would be a good place to start with. I am not sure if they provide for both C++ class and C function based approach.
  • 
    Thank you very much Amit.
    John
    -----
  • John Piliounis said:
    need to measure/benchmark which approach is faster and/or more efficient in terms of not only speed but also of memory usage.

    Should speed & memory usage (really) be of high interest you'd do well to consider the far more established & capable - vendor agnostic IDEs, Keil & IAR.   

    As one simple example - IAR provides a, "Cycle Counter" which automatically captures & displays the "Cycle burden" imposed by a user-selectable code block.    Lesser IDEs force extra code & effort upon such task - illustrating the advantage of a, "Pro/Long Established" IDE over lesser & so restricted fare...

  • 
    Dear cb1_mobile,
    Thank you for your answer and help.
    I'm already using CCS 7.0 which is free for some time now but
    the issue here is to identify the memory footprint of a class
    based functionality vs function based and also the speed/time 
    it takes for the two approaches to complete the exactly same
    operations.
    I think that I'm nearing to a benchmarking solution and soon
    as I'll have solid results I'll be back to inform the forum.
    Again, thank you very much,
    John
     
    P.S. Also let's have in mind that code running on the bare metal
    must be very well aware of the way it uses memory, because no
    OS is there to do the garbage collection work.
     
     
     
    -----
  • The far more established & capable IDEs have greater resources & by supporting MULTIPLE Vendors (essentially ALL comers) it is "usual" for their performance to much exceed the (in great contrast) offering of any single vendor.

    Your work would have higher value (I'd think) by its ability to, "Generalize" - extending across Multiple MCUs - from multiple vendors.   I don't believe that you've (yet) made a proper analysis of the "tools" available to you (free versions of both superior IDEs are provided) and a broader based, more efficient, superior solution/method is sure to raise the value & impact of your work...

  • 
    cb1_mobile you'r great and thank you a-lot for your help
    and suggestions.
    Although I'm already counting almost 35 years of programming
    on C & C++ for Linux & .NET environments, and also on 8051s
    and AVRs platforms for out of the work 8-bit projects of low
    profile, trying to do RT work on a bare-metal dude like the
    TM4C1294NCPTD and the like ICs is another "beast" by it self.
    So one needs all the help he can get from the experts.
     
    Choosing the Texas's CCS is due to a long time habit to trust
    Texas tools. Although other may be superior, I have a like to
    Texas stuff since I was a user and (my_first_money) programmer
    of the TI-59 marvel. At that time, writing programs for civil
    engineers and other engineering problems, or for educational
    purposes,  was something both magic and profitable. The sounds
    of the card reader, and the thermal printer where TI-59 could
    be plugged on, are still in my mind.  
     
    I have already been informed and found some more info on the
    benchmarking issue and I'll do some tests for the next couple
    of days. I hope I'll have solid results to transfer to the
    forum.
    Again, thankzzz a-lot,
    John
     
     
    -----
  • John,

    Your task is noble - you identified both, "Speed & Efficiency" as prime objectives w/in your initial posting. (one firm/myself found of much interest)

    Now arriving to this mix is, "familiarity" - and while that comforts - locking yourself to a, "tricycle - and that from only ONE vendor" seems to lessen the power of your results - does it not?

    Do note that the, "Pro IDEs" must, "Prove their worth/value" and have done so - for quite some time. Lesser, vendor-crippled versions - enjoy NO SUCH record of ongoing success. Might their central intent be, "Aid the Sale of ONLY vendor-based MCUs?" In great contrast - the "Pro/Vendor Agnostic IDEs" must function across MANY MCUs - which is bound to make them more encompassing, more detailed and capable of higher performance.

    I've been fortunate to visit both of the "Pro IDE vendors" - the size of their support staffs - their IDE-focused equipment investment - and their regular D&D (Design/Development) efforts "dwarf" that of the "single-vendor" offering.

    Again - "hamstringing" your work & findings to, "One vendor" - and employing that lesser development vehicle - cannot be expected to meet your (initial) declared objectives...
  • cb1_mobile, you'r one of a kind. Thank you very much for all of your efforts to give be profitable directions. I'll give you a riddle: OY GAR EX APANTOS DEI TO KERDAINEIN FILEIN, 

    As you may already know, better than I do, the one that makes the tool, knows it better. So I expect from Texas guys, who I trust, to answer to my queries. If they can't  I can understand.

    If they can and I don't understand then it's my problem. But in the bottom line, there is one simple question: If one wants to turn on and off 16 GPIOs 1000 times, is it better to do it

    using a classes-methods style of coding or a plain function call schema of coding on the TM4C1294NCPDT beaute? I might be able to give the answer by next Tuesday, if Texas folks

    haven't already answer on that.  

    Again, thank you very much,

    John