i++ vs i += 1 vs ++i vs i = i + 1 vs -~i (v4)

Revision 4 of this benchmark created on


Setup

i = 0;

Test runner

Ready to run.

Testing in
TestOps/sec
i++
i++;
ready
i += 1
i += 1;
ready
++i
++i;
ready
i = i + 1
i = i + 1;
ready
-~i
i = -~i;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.