University of Deusto, Bilbao, Spain.
University of Konstanz, Konstanz, Germany.
Behav Res Methods. 2019 Jun;51(3):1441-1453. doi: 10.3758/s13428-018-1126-4.
The Web is a prominent platform for behavioral experiments, for many reasons (relative simplicity, ubiquity, and accessibility, among others). Over the last few years, many behavioral and social scientists have conducted Internet-based experiments using standard web technologies, both in native JavaScript and using research-oriented frameworks. At the same time, vendors of widely used web browsers have been working hard to improve the performance of their software. However, the goals of browser vendors do not always coincide with behavioral researchers' needs. Whereas vendors want high-performance browsers to respond almost instantly and to trade off accuracy for speed, researchers have the opposite trade-off goal, wanting their browser-based experiments to exactly match the experimental design and procedure. In this article, we review and test some of the best practices suggested by web-browser vendors, based on the features provided by new web standards, in order to optimize animations for browser-based behavioral experiments with high-resolution timing requirements. Using specialized hardware, we conducted four studies to determine the accuracy and precision of two different methods. The results using CSS animations in web browsers (Method 1) with GPU acceleration turned off showed biases that depend on the combination of browser and operating system. The results of tests on the latest versions of GPU-accelerated web browsers showed no frame loss in CSS animations. The same happened in many, but not all, of the tests conducted using requestAnimationFrame (Method 2) instead of CSS animations. Unbeknownst to many researchers, vendors of web browsers implement complex technologies that result in reduced quality of timing. Therefore, behavioral researchers interested in timing-dependent procedures should be cautious when developing browser-based experiments and should test the accuracy and precision of the whole experimental setup (web application, web browser, operating system, and hardware).
网络是行为实验的重要平台,原因有很多(相对简单、无处不在、易于访问等)。在过去的几年中,许多行为和社会科学家使用标准的网络技术,无论是在原生 JavaScript 中还是在面向研究的框架中,都在进行基于互联网的实验。与此同时,广泛使用的网络浏览器的供应商一直在努力提高其软件的性能。然而,浏览器供应商的目标并不总是与行为研究人员的需求一致。虽然供应商希望高性能的浏览器能够几乎立即响应,并为了速度而牺牲准确性,但研究人员则有相反的权衡目标,希望他们基于浏览器的实验能够完全匹配实验设计和程序。在本文中,我们根据新的网络标准提供的功能,审查和测试了一些由网络浏览器供应商建议的最佳实践,以优化具有高分辨率定时要求的基于浏览器的行为实验中的动画。我们使用专门的硬件进行了四项研究,以确定两种不同方法的准确性和精度。结果表明,在关闭 GPU 加速的情况下,使用网络浏览器中的 CSS 动画(方法 1)会产生依赖于浏览器和操作系统组合的偏差。在最新版本的 GPU 加速网络浏览器上进行的测试结果表明,CSS 动画中没有帧丢失。使用 requestAnimationFrame(方法 2)而不是 CSS 动画进行的许多测试中也是如此,但并非所有测试都是如此。许多研究人员并不知道,网络浏览器的供应商实施了复杂的技术,导致定时质量降低。因此,对定时依赖程序感兴趣的行为研究人员在开发基于浏览器的实验时应该谨慎,并测试整个实验设置(网络应用程序、网络浏览器、操作系统和硬件)的准确性和精度。