While profiling minimp4 during MP4 encoding, find_start_code showed up as the most expensive function. Specifically, the first while loop searching for an initial zero byte. This is effectively what memchr() does, and glibc includes an optimized version of this method. Switching to memchr() showed a performance improvement in this method.
While profiling minimp4 during MP4 encoding, find_start_code showed up as the most expensive function. Specifically, the first while loop searching for an initial zero byte. This is effectively what memchr() does, and glibc includes an optimized version of this method. Switching to memchr() showed a performance improvement in this method.