Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
A
angle
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • angle
  • Repository

Switch branch/tag
  • angle
  • src
  • libANGLE
  • formatutils.cpp
Find file
BlameHistoryPermalink
  • Markus Tavenrath's avatar
    Don't generate TypeInfo objects as static objects within GetTypeInfo function · 0d665139
    Markus Tavenrath authored Nov 18, 2018
    Generating static objects within a function results in multithread safe
    code. This code generates the static objects upon the first execution of the
    line which declares the object. This results in high runtime cost for
    synchronization and a bigger code size.
    
    Instead introduce a new function uint32_t GetPackedTypeInfo(GLenum type)
    which returns a packed representation for the Type class. This
    representation is usually returned in a register on the assembly level.
    As a result we save constant storage for the TypeInfo object and one
    indirection when reading any value from this object. The Type constructor
    accepts the packed representation and unpacks it an inline function. For
    fields which are not used the compiler also applies dead code
    elimination which reduces the cost furthermore.
    
    As a result of this change the cost of GetTypeInfo is reduced by a
    factor of 4-5.
    
    Bug: angleproject:2974
    Change-Id: I8ed0bf2f09d087fa4cffa04f82e3b7f8c183fe30
    Reviewed-on: https://chromium-review.googlesource.com/c/1340221Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
    Commit-Queue: Jamie Madill <jmadill@chromium.org>
    0d665139
formatutils.cpp 130 KB
EditWeb IDE
×

Replace formatutils.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.