Skip to content

updateVoxelBoundarySegments() profiling #99

@cgyurgyik

Description

@cgyurgyik

This is called during each iteration when a radial step occurs. It updates the boundary segments for the azimuthal and angular boundaries.

Location in the traversal phase:

Screen Shot 2020-04-15 at 11 59 47 AM

The function:

Screen Shot 2020-04-15 at 11 04 43 AM

Profiling Call Tree:

Screen Shot 2020-04-15 at 12 03 25 PM

As shown, it is taking a large chunk of time.
Some potential fixes:

  • Replace grid.sphereCenter().x() with const double sphere_center_x (and similar for y, z) this MIGHT avoid extra lookups.
  • Raw for loops require the use of vector::size() and [] operator No single algorithm will be able to conduct what we're doing here, but I may be able to write an algorithm that does the following:
    Given two vectors A,B transform A, B while also using components from both itself and the other.

These are just micro-optimizations at the end of the day. Thinking about changes to the implementation may be necessary to truly reduce the footprint.

Maybe some kind of table look up to reduce calculations, or since voxel sizes are the same for each radial section other than orientation, we can use that information to minimize calculations.

Metadata

Metadata

Assignees

Labels

optimizationImprove code performance

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions