Forum Discussion
Altera_Forum
Honored Contributor
20 years ago --- Quote Start --- originally posted by thomsonbro+oct 20 2005, 08:54 am--><div class='quotetop'>quote (thomsonbro @ oct 20 2005, 08:54 am)</div>
--- quote start ---
when fooling around with the performance counter inside the lwip checksum routines, i discovered that in the lwip_checksum routine, the actual making of the checksum is 10% of the load, the reaming 90% is cedited to the return stament at the end, totalling over 50000 clock cycles for returning a value...[/b]
--- quote end ---
wow. that does look funny, but i have to wonder if it's crediting loop-control time to that return statement, or more likely, if it's doing a lot of restore-calling-state-before-return work. or maybe you're getting interrupted there?
<!--quotebegin-thomsonbro@Oct 20 2005, 08:54 AM does returning the value really take this long? i dont understand this, if this is correct then using hw to do the checksumming would give me less then 10% increase (i cant go from 15 clock cycles to 0 for the checksum operation after all, it will still be 5 cycles or so) --- Quote End --- Sounds like you just need to replace the whole function call with a custom instruction or macro...?