• jdduke's avatar
    Avoid heap allocation with uncoalesced touch events · 59886ae9
    jdduke authored
    Each enqueued event in the browser-side touch queue maintains a vector
    of events that must be ack'ed, allowing each enqueued event to coalesce
    with subsequent events delivered from the platform. Currently, the
    vector is always populated with the first event, even if no coalescing
    occurs. Instead, defer population until coalescing occurs, optimizing
    the common case for most events by avoiding an extra heap allocation for
    every touch. This can save ~5-10us per forwarded touch event on a typical
    Android device.
    
    BUG=384562
    
    Review URL: https://codereview.chromium.org/565033002
    
    Cr-Commit-Position: refs/heads/master@{#295998}
    59886ae9
touch_event_queue.cc 29.9 KB