Are you sure that's testing the hard case? Setting style attributes doesn't trigger any kind of layout modification right now.

Cheers,
Josh

On 05/19/2013 10:38 PM, Patrick Walton wrote:
On 5/18/13 3:27 PM, Brian Anderson wrote:
# The numbers

function call ns per call:                                    2
new scheduler cross-task call ns per call:   2217
old scheduler cross-task call ns per call:   14737

I did a very quick microbenchmark of Servo's "hard case" for layout
using the HTML document attached and came up with about 47 microseconds
per layout in Gecko. So these early results seem promising; 2
microseconds does not seem significant in comparison. Of course this is
very early and a back-of-the-envelope calculation, so I may have messed up.

Patrick

---

<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body>
<div style="position: absolute; width: 100px; height: 100px; top: 0px;
left: 5px; background-color: red;" id=d></div>
<script>
var d = document.getElementById('d');
var then = Date.now();
var pos = 0;
var count = 0;
while (Date.now() < then + 1000) {
     pos = (pos + 1) % 256;
     d.style.top = pos + 'px';
     d.getBoundingClientRect();
     ++count;
}
console.log("" + count + " iterations");
</script>
</body>
</html>



_______________________________________________
dev-servo mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to