Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preload of visual search plugin stimuli effective on Chrome but not Firefox #397

Open
jtg567 opened this issue Jun 19, 2017 · 4 comments
Open
Labels

Comments

@jtg567
Copy link

jtg567 commented Jun 19, 2017

Despite preloading and on Firefox but not Chrome, I've noticed latency for images on only their first appearance in visual search arrays.

It is especially problematic (and hilarious) in new blocks where the target is novel and there's a distinct exogenous capture effect on the first trial it's present in, as usually all of the foils have made an appearance by the end of the first block.

You can observe in context here: https://bg-stage.herokuapp.com/game/icon_vs_1/?rnid=GitHub&study=test

@jodeleeuw jodeleeuw added the bug label Jun 20, 2017
@jodeleeuw
Copy link
Member

Are other plugins showing this difference between Firefox and Chrome in your setup? Or do you think this is specific to the visual search plugin?

@Osmose
Copy link

Osmose commented Jun 20, 2017

Looked into this briefly; the images are being preloaded correctly, and aren't being re-requested when displayed. It's an issue with how long Firefox is taking to paint the images on the page.

I initially thought this was due to excess paints from the plugin appending a bunch of images to the DOM via innerHTML in a loop, but replacing that with a document fragment (so that we only append to the DOM once at the end of the loop) didn't really help things. I still think that might be a useful thing to do though.

The most foolproof way of avoiding this would be to paint the images on a canvas, and then display that canvas to the user. This might not fit within the timing constraints of the trials on slow hardware though.

@jtg567
Copy link
Author

jtg567 commented Jun 20, 2017

@jodeleeuw I have suspected at times that instruction images have a tiny latency appearing, but I'm not sure how I would observe that empirically. It could be that only in the case of these visual search trials that conditions are such that the effects of the bug are striking.

@Osmose does that explain how it only affects the first appearance of each image? By the end of most blocks there's no perceivable offset between any images.

edit: fwiw, Edge appears to be affected in the same way as Firefox.

@jodeleeuw
Copy link
Member

jodeleeuw commented Jun 20, 2017

Good point about all the paint operations. That's something that I've been trying to fix in other plugins. It's a bad habit that I need to kick.

The preloading functionality isn't as reliable as I'd hoped. There are other issues -- #302, #275 -- that seem to be related to this general problem.

I've asked a couple questions on Stack Overflow to try and understand the limitations of preloading (1, 2), but haven't figured out a truly reliable way to do it.

If anyone has thoughts about a better way to do preloading I'm open to overhauling chunks of the code to improve it.

@jodeleeuw jodeleeuw added this to the 7.0 milestone Jul 1, 2017
@jodeleeuw jodeleeuw modified the milestones: 7.0, 7.3 Jun 11, 2020
@jodeleeuw jodeleeuw removed this from the 7.3 milestone Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants