Edited output of the timing code, see timing_code.diff for the actual code. Option 1: Original 3.5.0 code: Avg time 0.002 ms based on 29 thumbnails or medium-sized images. Option 2: Proposed 3.5.1 code (Calling image_constrain_size_for_editor()): Avg time 0.439 ms based on 29 thumbnails or medium-sized images. Option 3: Equivalent 3.4 code (Calling image_downsize()): Avg time 9.781 ms based on 29 thumbnails or medium-sized images.