getter vs extension method (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script>
var now = new Date();

Date.prototype.Formatada = function() {
  return this.getUTCDate() + "/" + this.getUTCMonth() + "/" + this.getUTCFullYear();
};

Object.defineProperty(Date.prototype, "Today", { get: function() { return this.getUTCDate() + "/" + this.getUTCMonth() + "/" + this.getUTCFullYear(); } })

</script>

Test runner

Ready to run.

Testing in
TestOps/sec
extensionmethod
now.Formatada();
ready
getter
now.Today;
ready

Revisions

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