optimized blenloader for loops #106573

Closed
glitchy-virophage wants to merge 31 commits from (deleted):main into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor

I replaced postfix increment in many for loops with prefix decrement to save computer resources and increase speed. alot with postfix while loops with prefix while i was at it. unfortuentaly i was unable to benchmark it due to errors i was experiencing, but i tested it against the unmodifed code with a large high quaility model

I replaced postfix increment in many for loops with prefix decrement to save computer resources and increase speed. alot with postfix while loops with prefix while i was at it. unfortuentaly i was unable to benchmark it due to errors i was experiencing, but i tested it against the unmodifed code with a large high quaility model
glitchy-virophage added 23 commits 2023-04-04 22:43:52 +02:00
8ad6e5819d did small loop optimizations to source/blender/blenloader/intern/blend_validate.cc
replaced postincrement for the varible i with preincrement
f72b93dc02 did some loop optimizations to source/blender/blenloader/intern/readblenentry.cc
replaced some postincrement for the variable tot with preincrement
replaced postincrement for the variable preview_index with predecrement in line 230 for larger optimization
b4fb43644b did some loop optimizations to source/blender/blenloader/intern/readfile.cc
replaced postdecrement in some while loops with predecrement to save a small amount of resources
replaced postincrement in some for loops with predecrement to save alot of resources
2dc3051d35 did large loop optimizations to source/blender/blenloader/intern/versioning_250.c
replaced postincrement in some for loops with predecrement to save alot of resources
8ab10a88c2 did some loop optimizations to source/blender/blenloader/intern/readblenentry.cc
replaced postfix in some while loops and if statements with prefix to save a smalll amount of resorces
replaced postincrement in some for loops with predecrement to save alot of resources
b6cafca9f1 did big loop optimizations to source/blender/blenloader/intern/versioning_270.c
replaced a postdecrement in a while loop with predecrement to save a small amount of resources
replaced postincrement in some for loops with predecrement to save a large amount of resources
6b01dea352 did large loop optimizations to source/blender/blenloader/intern/versioning_280.c
replaced the postincrement in some for loops with predecrement to save alot of resources
c09454265f did large loop optimizations to source/blender/blenloader/intern/versioning_290.cc
replaced postincrement in some for loops with predecrement to save lot of resources
c440322780 did more large loop optimizations to source/blender/blenloader/intern/versioning_290.cc
i missed some for loops and replaced their postincrement with predecrement
664d0e5765 did large loop optimizations to source/blender/blenloader/intern/versioning_300.cc
replaced the postincrement in some for loops with predecrement to save resources
e4a2de4a9c did small loop optimizations to source/blender/blenloader/intern/writefile.cc
optimized some while loops by replacing postfix with prefix
Member

Thanks for the work, but this sort of change makes code more complicated by increasing the scope of variables and making the for loop pattern harder to read.

This sort of thing is one of the things we typically rely on compilers to optimize anyway. It's easy because all of the logic is integer arithmetic and it's happening with completely local data.

So, such a PR would have to be very convincing with benchmarks showing significant performance differences.

Thanks for the work, but this sort of change makes code more complicated by increasing the scope of variables and making the for loop pattern harder to read. This sort of thing is one of the things we typically rely on compilers to optimize anyway. It's easy because all of the logic is integer arithmetic and it's happening with completely local data. So, such a PR would have to be very convincing with benchmarks showing significant performance differences.
Hans Goudey closed this pull request 2023-04-04 22:54:48 +02:00
Author
First-time contributor

i fixed the benchmark error and i got some mixed results

i fixed the benchmark error and i got some mixed results
Author
First-time contributor

here is a another test

here is a another test
glitchy-virophage added 1 commit 2023-05-05 01:44:49 +02:00
glitchy-virophage added 1 commit 2023-05-05 02:05:42 +02:00
glitchy-virophage added 1 commit 2023-05-05 04:15:45 +02:00
glitchy-virophage added 1 commit 2023-05-07 03:48:05 +02:00
glitchy-virophage added 1 commit 2023-05-07 05:04:32 +02:00
glitchy-virophage added 1 commit 2023-05-08 09:09:13 +02:00
glitchy-virophage added 1 commit 2023-05-09 10:20:16 +02:00
glitchy-virophage added 1 commit 2023-05-09 10:49:52 +02:00
Author
First-time contributor

I improved the readability

I improved the readability
glitchy-virophage reopened this pull request 2023-05-09 10:59:12 +02:00

Pull request closed

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 project
No Assignees
2 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#106573
No description provided.