Benchmark MarkerAttribute #84
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Research
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Total time spent: 1 hour 1 minute
Due date
c.fahner
1 hour 1 minute
No due date set.
Dependencies
No dependencies set
Reference
slendium/ocd#84
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The method
::isMarked()for theMarkerAttributetrait is used quite frequently and inside loops (eg.Schema::fromClass()). The fastest way to check should be benchmarked and applied:foreach ($reflector->getAttributes(static::class) as $_) { return true; }return \count($reflector->getAttributes(static::class) > 0;return isset($reflector->getAttributes(static::class)[0]);return !empty($reflector->getAttributes(static::class)[0]);Only the foreach variant is marginally slower. The bottleneck seems to be the call to
getAttributes().