Swift Playgrounds: Arranging Assistants For Speed

Screen Shot 2015-07-01 at 10.39.28 AM

Sometimes, the best way to optimize a playground is by moving nearly every line of code out of it.

Consider the layout used in the screenshot at the top of this post. The playground is at the very top. It includes just one line that runs a Go function.

The remaining assistant area is split in two. To the left is a Sources editor and to the right is the playground timeline output. It’s displaying the results of a capture value sequence for the GameplayKit random samples I posted about yesterday. I wasn’t fully happy with the layout I’d been using and between then and now, came up with this one.

Simulating a hundred thousand random samples is processor heavy. This layout enables me to use built-in playground visualization features and module compilation optimization. The results are terrific: fast interactive exploration with the side-by-side presentation you normally get in the default playground layout.

Like the hacks? Read the book.

Comments are closed.