use StackableTrait;
use IndexableTrait;
+ /**
+ * Configuration cache
+ */
+ private static $configCache = [];
+
/**
* Current seek position
*/
* @return void
*/
private function markFileGapsOnly (string $type, int $minimumBlockLength) {
- // Very simple to do ...
+ // Is config cache there?
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: type=%s,minimumBlockLength=%d - CALLED!', $type, $minimumBlockLength));
- for ($idx = 0; $idx < FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($type . '_pre_allocate_count'); $idx++) {
+ if (!isset(self::$configCache[$type . '_pre_allocate_count'])) {
+ // Then set it
+ self::$configCache[$type . '_pre_allocate_count'] = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($type . '_pre_allocate_count');
+ }
+
+ // Very simple to do ...
+ for ($idx = 0; $idx < self::$configCache[$type . '_pre_allocate_count']; $idx++) {
// Calculate start/end positions
$startPosition = $idx * $minimumBlockLength;
$endPosition = $idx * $minimumBlockLength + $minimumBlockLength;