Skip to content

Commit

Permalink
feat: decrease query count by cacheing some RDF property fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Makar Sichevoi committed Nov 2, 2023
1 parent db207e0 commit 7d804f9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions helpers/class.PropertyCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ class helpers_PropertyCache
/**
* Clear property cached data
*/
public static function clearCachedValues(Iterator $triples): void
public static function clearCachedValuesByTriples(Iterator $triples): void
{
foreach ($triples as $triple) {
$property = new \core_kernel_classes_Property($triple->predicate);
$property->clearCachedValues();
$classProperty = new \core_kernel_classes_Property($triple->predicate);
$classProperty->clearCachedValues();
}
}

/**
* Warmup property cached data
*/
public static function warmupCachedValues(Iterator $triples): void
public static function warmupCachedValuesByProperties(array $properties): void
{
foreach ($triples as $triple) {
$property = new \core_kernel_classes_Property($triple->predicate);
$property->warmupCachedValues();
foreach ($properties as $property) {
$classProperty = new \core_kernel_classes_Property($property);
$classProperty->warmupCachedValues();
}
}
}

0 comments on commit 7d804f9

Please sign in to comment.