Skip to content

Instantly share code, notes, and snippets.

@aforren1
aforren1 / gsoc2022.md
Last active September 29, 2022 04:11
Reducing Chrome’s Presentation Latency on Windows

Reducing Chrome’s Presentation Latency on Windows

Alex Forrence
email: alex.forrence@gmail.com

Intro

For this project, I improved presentation latency in Chrome on Windows by introducing waitable swap chains. Waitable swap chains allow us to both reduce latency by shortening the queue of pending frames and aligning frame production for optimal consumption by the operating system, and reduce latency spikes by dropping frames under load.

Initial proposal:

import moderngl as mgl
import glfw
import numpy as np
import glm
import mapbox_earcut as earcut
from timeit import default_timer
from xxhash import xxh32
vao_cache = {}
@aforren1
aforren1 / bgfx-drawstress
Last active November 8, 2020 21:38
glmark2 for the NVIDIA Jetson Nano 2GB, fullscreen and default settings
Usually 10648 draw calls (22 Dim) at 60fps
# Speech 2
## Gratitude
Great job to <maid of honor>! I was tearing up there at the end.
I'd like to say a few words of thanks:
First and foremost to Natasha and Matt, for inviting all of us to share in their special day
@aforren1
aforren1 / tmp
Last active March 17, 2019 16:19
https://ci.appveyor.com/api/buildjobs/9lty5fdd9a8y133i/artifacts/dist/ratcave-0.8.0-cp37-cp37m-win_amd64.whl
Install raspbian (https://www.raspberrypi.org/downloads/raspbian/)
run `sudo apt update && sudo apt upgrade --yes`
Turn on desktop GL in `sudo raspi-config`
(sudo apt install mesa-utils & run glxgears for verification)
edit /boot/config.txt and add `gpu_freq=500` (overclocks the GPU from 400->500) and `gpu_mem=320` (gives the GPU more memory)
# Install preemptive kernel
apt install build-essential git linux-image-rt-amd64 -y # check with `uname -r`
# Install miniconda (update later via `conda update conda`
wget http://repo.continuum.io/miniconda/Miniconda3-3.7.0-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda # accept license, add to path
echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> ~/.bashrc
# update audio settings
class Experiment(Machine):
def is_line_crossed(self): return self.line_crossed
def reset_line(self): self.line_crossed = False
def done_countdown(self):
self.countdown_done = True
print "Done the countdown"
def start_countdown(self):

IDE

  • rstudio

Reproducible research tools

  • packrat - roughly equivalent to python's virtualenv (isolated package env)
  • drake/remake - like GNU make (I think drake is better maintained at this point, but few examples)
  • RStudio's projects - at least drops you in the right working directory & ties in with packrat
  • Make a package! - higher startup cost, but user installation is trivial
  • rocker (R through Docker)

We'll stick to 32-bit installation (to make iohub happy?)

  1. Install python 2.7.12 x86 (make sure to add python to your PATH var, just for ease-of-use)
  • We use this version solely for compatibility with the nidaqmx package (2.7.14 being compatible when it comes out)
  • Ideally, psychopy will eventually support 3.x, which is actively developed
  1. Install wheels for numpy and scipy from http://www.lfd.uci.edu/~gohlke/pythonlibs/
  • for instance, use numpy‑1.12.1+mkl‑cp27‑cp27m‑win32.whl because we're using python 2.7 on 32 bit
  • python -m pip install <path_to_numpy_whl>.whl
  • We install these two globally because they're cumbersome to keep re-installing and rather large