Skip to content

Conversation

@mBeym
Copy link
Contributor

@mBeym mBeym commented Jan 23, 2026

If accepted should be picked into trunk.

* @return Generator<list<array{start_time: int, end_time: ?int, end_context: ?int}>>
*/
protected static function getRawData(int $a_begin, int $a_end): array
protected static function getRawData(int $a_begin, int $a_end): Generator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use a "Prepared Statement" here as well?

$raw_data = [];
while (is_array($slot)) {
self::aggregateRawHelper($slot[0], $slot[1]);
$raw_data[] = self::aggregateRawHelper($slot[0], $slot[1]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to introduce a new buffer for all the aggregated data here?

I think this can lead to a huge amount of memory being allocated.

Since all fields in \ilSessionStatistics::aggregateRawHelper are of type integer, there should not be any problem with using ilDBInterface::prepareManip and ilDBInterface::execute here.

@mjansenDatabay mjansenDatabay added improvement php Pull requests that update Php code labels Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants