BLI: add chunked list data structure that uses linear allocator #118774
No reviewers
Labels
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118774
Loading…
Reference in New Issue
No description provided.
Delete Branch "JacquesLucke/blender:linear-allocator-unordered-list"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds a new special purpose container data structure that can be used to gather many elements into many (potentially small) lists efficiently.
I originally worked on this data structure because I might want to use it in #118772. However, also it's useful in the geometry nodes logger already. I'm measuring a 10-20% speed improvement in my many-math-nodes file when I enable logging for all sockets (not just the ones that are currently visible).
Comparing this
VectorList
, and your oldChunkList
container, I guess this makes more sense for a small number of elements? i.e. the goal is to avoid wasting memory than avoiding reallocations?Yeah, and also to avoid many small allocations when having potentially very many of these vectors. With this new type, they can all share the same few global allocations.
@ -0,0 +12,4 @@
namespace blender::linear_allocator {
template<typename T, int64_t Capacity> struct UnorderedListSegment {
Is there the chance to have structure with ~the same fields (
next
,size
) but with runtime size of values (so kind of raw bits array with header and values)?It is good to just have template, but sometime you just want to push span with known size in trivial way..
In theory we could have that, but this is a very special purpose data structure, and currently we need the ability you're requesting. Supporting it would cause additional overhead.
@blender-bot build
WIP: BLI: add unordered list data structure that uses linear allocatorto BLI: add unordered list data structure that uses linear allocatorLooks good to me. Thanks for adding more to the comment. How about calling this
ChunkedList
? The "unordered" part doesn't seem as important as the fact that multiple items are stored together in small chunks.@ -0,0 +1,190 @@
/* SPDX-FileCopyrightText: 2023 Blender Authors
2024
BLI: add unordered list data structure that uses linear allocatorto BLI: add chunked list data structure that uses linear allocator