Skip to main content

Timeline for Custom memcmp function

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
Feb 7, 2016 at 2:59 history edited 5gon12eder CC BY-SA 3.0
mention the n == 0 case (credit to chux)
Feb 7, 2016 at 2:50 history edited 5gon12eder CC BY-SA 3.0
prettier code, nicer graphic and early exit
Feb 5, 2016 at 5:25 comment added Loki Astari hoping the standard library implementers knew what they did :-)
Feb 5, 2016 at 4:02 comment added 5gon12eder @LokiAstari Thank you ;-) I don't think that ints will be faster than longs on (m)any platforms. They might be the same, of course. As I've written in my answer, I've gained almost 50 % speedup just by changing the typedef but of course, that only reinforces your suggestion to always measure. If you need to optimize for platforms you don't have to experiment on, maybe using uint32_fast_t might be useful, hoping the standard library implementers knew what they did.
Feb 5, 2016 at 3:45 comment added Loki Astari Fantastic write up. One of the best I have seen. Especially the use of the graph to show the relative speeds. But I disagree with Prefer longs over ints not that I prefer ints but I think it is another thing that can be explicitly tested to see if it improves performance (I suspect it will but am not 100% sure that it will help on all architectures).
Feb 5, 2016 at 2:49 history edited 5gon12eder CC BY-SA 3.0
Added nicer graph and concrete numbers for int -> long improvement.
Feb 5, 2016 at 2:44 history edited 5gon12eder CC BY-SA 3.0
Added nicer graph and concrete numbers for int -> long improvement.
Feb 5, 2016 at 2:17 history edited 5gon12eder CC BY-SA 3.0
added 30 characters in body
Feb 5, 2016 at 2:05 history edited 5gon12eder CC BY-SA 3.0
deleted 62 characters in body
Feb 5, 2016 at 1:56 history answered 5gon12eder CC BY-SA 3.0