Optimizing C++ Code with O(1) Operations -- Giovanni Dicanio

Continuing from the previous Adventures with string_view post, in this new article I show how you can achieve massive performance gains using code characterized by O(1) constant-time asymptotic complexity.

Adventures with string_view: Optimizing Code with O(1) Operations

by Giovanni Dicanio

From the article:

While this code works fine, it’s possible to optimize it.

As the saying goes, first make things work, then make things fast.

Replacing a O(N) operation with a O(1) operation in this case gives a performance boost of 88 ms vs. 445 ms, which is an 80% performance gain!

 

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.