While the drawing code already skipped drawing any key points that are not in view, it did that with an `if` check within the `for` loop. This can be speed up quite a bit by calculating the bounding indices beforehand and only iterating that range. | - | Before | After | | - | - | - | | `draw_fcurve_selected_keyframe_vertices` | 44850ns | 3194ns | | `graph_main_region_draw` | 32ms | 21ms | Test file used https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend Pull Request: https://projects.blender.org/blender/blender/pulls/120521