Changeset 248025 in webkit


Ignore:
Timestamp:
Jul 30, 2019, 5:31:43 PM (6 years ago)
Author:
sbarati@apple.com
Message:

[WHLSL] Add a fast path for TypeNamer::insert where we've already seen the type
https://bugs.webkit.org/show_bug.cgi?id=200284

Reviewed by Myles C. Maxfield.

This is a ~27% speedup in the WHLSL::prepare for the compute_boids test.
This optimization makes sense since my previous patch to make UnnamedType
ref counted was also a huge speedup. So the TypeNamer is seeing many
UnnamedTypes which are the same pointer value. On compute_boids, this
makes generateMetalCode ~40ms faster.

  • Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:

(WebCore::WHLSL::Metal::TypeNamer::insert):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r248024 r248025  
     12019-07-30  Saam Barati  <sbarati@apple.com>
     2
     3        [WHLSL] Add a fast path for TypeNamer::insert where we've already seen the type
     4        https://bugs.webkit.org/show_bug.cgi?id=200284
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        This is a ~27% speedup in the WHLSL::prepare for the compute_boids test.
     9        This optimization makes sense since my previous patch to make UnnamedType
     10        ref counted was also a huge speedup. So the TypeNamer is seeing many
     11        UnnamedTypes which are the same pointer value. On compute_boids, this
     12        makes generateMetalCode ~40ms faster.
     13
     14        * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
     15        (WebCore::WHLSL::Metal::TypeNamer::insert):
     16
    1172019-07-29  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp

    r247917 r248025  
    318318BaseTypeNameNode* TypeNamer::insert(AST::UnnamedType& unnamedType, Vector<UniqueRef<BaseTypeNameNode>>& types)
    319319{
     320    if (auto* result = m_unnamedTypeMapping.get(&unnamedType))
     321        return result;
     322
    320323    Vector<UniqueRef<BaseTypeNameNode>>* vectorToInsertInto { nullptr };
    321324    BaseTypeNameNode* parent { nullptr };
Note: See TracChangeset for help on using the changeset viewer.