Cycles: add /jumptablerdata to MSVC compiler flags #110470

Merged
Xavier Hallade merged 1 commits from xavierh/blender:jumptablerdata into main 2023-07-25 19:19:44 +02:00
Member

Starting with MSVC 17.7 preview 3, the /jumptablerdata flag is available and allows to ensure jump tables don't get mixed with the code, helping on performance when there is contention in a large switch statement, such as in svm_eval_nodes.

On my machine with a 13900K CPU, it gives a +2% speedup in average:

scene speedup
attic 1.02
bistro 1.01
cyclesx_barbershop_interior 1.02
cyclesx_bmw27 1.01
cyclesx_classroom 1.02
cyclesx_fishy_cat 1.01
cyclesx_junkshop 1.02
cyclesx_koro 1.03
cyclesx_monster 1.01
cyclesx_pabellon 1.03
cyclesx_pvt_flat 1.02
lone_monk 1.02
secret_deer 1.04
sponza 1.03
spring 1.01
average 1.02
Starting with MSVC 17.7 preview 3, the `/jumptablerdata` flag is available and allows to ensure jump tables don't get mixed with the code, helping on performance when there is contention in a large switch statement, such as in `svm_eval_nodes`. On my machine with a 13900K CPU, it gives a +2% speedup in average: | scene | speedup | | --------------------------- | ------- | | attic | 1.02 | | bistro | 1.01 | | cyclesx_barbershop_interior | 1.02 | | cyclesx_bmw27 | 1.01 | | cyclesx_classroom | 1.02 | | cyclesx_fishy_cat | 1.01 | | cyclesx_junkshop | 1.02 | | cyclesx_koro | 1.03 | | cyclesx_monster | 1.01 | | cyclesx_pabellon | 1.03 | | cyclesx_pvt_flat | 1.02 | | lone_monk | 1.02 | | secret_deer | 1.04 | | sponza | 1.03 | | spring | 1.01 | | **average** | **1.02** |
Xavier Hallade added 1 commit 2023-07-25 19:00:23 +02:00
37817cfc24 Cycles: add /jumptablerdata to MSVC compiler flags
Starting with MSVC 17.7 preview 3, /jumptablerdata is available and
allows to ensure switch tables don't get mixed with the code, helping on
performance when there is contention in a large switch statement, such
as in svm.h.
Xavier Hallade added the
Module
Render & Cycles
label 2023-07-25 19:00:37 +02:00
Xavier Hallade added this to the 4.0 milestone 2023-07-25 19:00:40 +02:00
Xavier Hallade added this to the Render & Cycles project 2023-07-25 19:00:44 +02:00
Xavier Hallade requested review from Brecht Van Lommel 2023-07-25 19:01:03 +02:00
Brecht Van Lommel approved these changes 2023-07-25 19:18:15 +02:00
Brecht Van Lommel left a comment
Owner

Nice find.

Nice find.
Xavier Hallade merged commit 716f909a4f into main 2023-07-25 19:19:44 +02:00
Xavier Hallade deleted branch jumptablerdata 2023-07-25 19:19:45 +02:00
Ray molenkamp reviewed 2023-07-25 19:32:43 +02:00
@ -86,0 +86,4 @@
# "jumptablerdata" improves performance when there is contention in large switch statements such as in svm.h
# This flag is supported starting with MSVC 17.7 preview 3:
# https://learn.microsoft.com/en-us/cpp/build/reference/jump-table-rdata
if(MSVC_VERSION GREATER_EQUAL 1937)
Member

I don't think 1937 is specific enough to target 17.7 preview 3, non developers do use the preview compilers these days and may still be on update 1 or 2 (we black listed 17.6 due to a bad codegen, which moved some blender enthusiast style users over to the preview channel but i don't see them updating it on a regular basis)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.37.32820) 

should do nicely though. (19.37.32820 is 17.7 preview 3)

I don't think 1937 is specific enough to target 17.7 preview 3, non developers do use the preview compilers these days and may still be on update 1 or 2 (we black listed 17.6 due to a bad codegen, which moved some blender enthusiast style users over to the preview channel but i don't see them updating it on a regular basis) ``` if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.37.32820) ``` should do nicely though. (19.37.32820 is 17.7 preview 3)
Author
Member

sure! your proposition will be nicer to them, done with b0d1226b6c

sure! your proposition will be nicer to them, done with https://projects.blender.org/blender/blender/commit/b0d1226b6cb16a155ce8a89840f0ff326ea3f4aa
xavierh marked this conversation as resolved
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#110470
No description provided.