Skip to content

Commit 05a7b48

Browse files
committed
refactor(entity_filter): simplify performance optimization comments
1 parent c9a51e7 commit 05a7b48

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

internal/engines/entity_filter.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,14 +433,11 @@ func (engine *EntityFilter) lt(
433433

434434
// pathChainEntrance handles multi-hop relation chain traversal for nested attributes
435435
//
436-
// TODO: This function can be optimized for better performance by implementing smart batching logic:
436+
// TODO: Optimize performance with smart batching:
437437
// - Extract unique attributes from path chain entrances to avoid duplicate queries
438-
// - Implement batch vs individual processing based on scope and attribute count:
439-
// - Use batch mode when we have scope (limited entity IDs) or few attributes (<=1)
440-
// - Use individual mode when no scope and multiple attributes to avoid loading large result sets
441-
// - Refactor into smaller helper functions: extractUniqueAttributes, getScopeIds, shouldUseBatchMode,
442-
// processBatchMode, processIndividualMode, queryAttributesBatch, processEntranceWithResults
443-
// - Remove debug statements after optimization is tested
438+
// - Use batch processing when scope limits entity IDs or when attribute count is low (<=1)
439+
// - Use individual processing when no scope exists and multiple attributes are present
440+
// - Consider refactoring into helper functions for improved maintainability
444441
func (engine *EntityFilter) pathChainEntrance(
445442
ctx context.Context,
446443
request *base.PermissionEntityFilterRequest,

0 commit comments

Comments
 (0)