Lazy load export image, halving the startup time

Review Request #129167 - Created Oct. 13, 2016 and submitted

Peter Wu
Conversion of a pixmap to a data URI is quite expensive. On my Skylake
laptop (i7-6500HQ), it took one second to start. A perf trace showed
that 65% of the time was spent in ExportManager::pixmapDataUri.

Compile spectacle with debug info and obtain a perf trace:

# close as soon as you see the window
perf record --call-graph=dwarf src/spectacle
# open five times, press Escape as soon as you seen the window
time src/spectacle

Repeat experiment and compare times and perf traces (perf diff and perf report -i

To test that export is still working: open Export menu, hover over Share. The first time there is a small delay, the next time it will be faster due to lazy loading.


  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Aleix Pol Gonzalez
Peter Wu
Boudhayan Gupta
Peter Wu
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit a6911eb80af1f67c9130d7749b3161cc40467041 by Peter Wu to branch master.