with vs dot

Benchmark created by cHao on


Description

I've heard that "with" is slow. Let's see.

Setup

foo = { x : 0 };

Test runner

Ready to run.

Testing in
TestOps/sec
with
with (foo) { x += 1; x += 1; x += 1; }
ready
dot
foo.x += 1; foo.x += 1; foo.x += 1;
ready

Revisions

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