JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://unpkg.com/immer@6.0.3/dist/immer.umd.production.min.js"></script>
<script>

class Foo {
	[immer.immerable] = true;	
  	a = 1;
  	b = 2;
  	c = 3;
  	d = 4;
  	e = 5;
  	f = 6;
  	g = 7;
  	h = 8;
  	i = 9;
  	j = 10;
  	k = 11;
  	l = 12;
}

function test(name, o)
{
	const start = performance.now();
	console.time(name); 
	for (let i=0; i<100000; i++) {
		immer.produce(o, proxy => {proxy.a = i; });
	}
	const stop = performance.now();
	const elapsed = stop - start;
	console.log(name, elapsed);
	return elapsed;
}

// test simple class instance
const thing1 = new Foo();
const time1 = test("class", thing1);

// test plain JavaScript with same information
const thing2 = JSON.parse(JSON.stringify(thing1));
const time2 = test("object", thing2);

const ratio = time1/time2;
console.log("x slower with class", ratio);

 </script>