It would also be worth looking into the various hardware based options supported by ffmpeg:
https://trac.ffmpeg.org/wiki/HWAccelIntro
...but I don't use that stuff so I can only mention it.
]]>ffmpeg -f x11grab -video_size 1366x768 -framerate 15 -i $DISPLAY -f alsa -i default -c:v libx264 -preset ultrafast -c:a aac screen.mp4
EDIT
I was able to get a significant performance upgrade by skipping encoding entirely:
ffmpeg -f x11grab -video_size 1366x768 -framerate 15 -i $DISPLAY -f alsa -i default -c:v libx264 -crf 0 -preset ultrafast -c:a aac screen.mkv