Skip to content

raytracer: use lighter triangle class to reduce memory consumption#2

Merged
adrientoub merged 5 commits intomasterfrom
basic_triangles
May 20, 2025
Merged

raytracer: use lighter triangle class to reduce memory consumption#2
adrientoub merged 5 commits intomasterfrom
basic_triangles

Conversation

@adrientoub
Copy link
Copy Markdown
Owner

  • should speed up all memory copies
  • should improve data locality
  • should reduce memory consumption (a lot) of meshes
  • removes duplicate attributes & color copied in mesh
  • breaking change, parsing of Mesh is changed
    • old:
      mesh name
      triangle name a b c attr color
      ...
      end
    • new
      mesh name attr color
      triangle a b c
      ...
      end
      triangle names had no use at all and attributes and color were
      duplicates across all lines

* should speed up all memory copies
* should improve data locality
* should reduce memory consumption (a lot) of meshes
* removes duplicate attributes & color copied in mesh
* breaking change, parsing of Mesh is changed
  - old:
    ```
    mesh name
      triangle name a b c attr color
      ...
    end
    ```
  - new
    ```
    mesh name attr color
      triangle a b c
      ...
    end
    ```
  triangle names had no use at all and attributes and color were duplicates accross all lines
@adrientoub
Copy link
Copy Markdown
Owner Author

Before:
==12902== HEAP SUMMARY:
==12902== in use at exit: 0 bytes in 0 blocks
==12902== total heap usage: 29,302,973 allocs, 29,302,973 frees, 1,408,478,583 bytes allocated

After:
==12744== HEAP SUMMARY:
==12744== in use at exit: 0 bytes in 0 blocks
==12744== total heap usage: 29,227,774 allocs, 29,227,774 frees, 1,402,713,421 bytes allocated

@adrientoub adrientoub merged commit b9eef21 into master May 20, 2025
@adrientoub adrientoub deleted the basic_triangles branch May 20, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant