Yes, it is Window#record, which is often used in this way:
def draw
@recording ||= $window.record 1, 1 do
10000.times { draw something }
end
@recording.draw 0, 0, 0
end
The values passed to record are the effective width and height of the recorded area. They only make a difference if you want to use center_x/center_y or rotation on the recording. I generally don't so 1, 1 suffices :)
This puts all the sprite draws into a vertex array, so they can be drawn incredibly fast (at least 100x faster than they would drawn manually).