Optimizations for markers (clamping count to 100)

This fixes #1282 

Review @devoncarew