Skip to content

Conversation

@fingolfin
Copy link
Member

Avoid enlarging their SLPs when there is no need for it.

@fingolfin fingolfin requested a review from ThomasBreuer April 2, 2025 13:22
@fingolfin fingolfin added topic: performance bugs or enhancements related to performance (improvements or regressions) release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: library labels Apr 2, 2025
Copy link
Contributor

@ThomasBreuer ThomasBreuer left a comment

Choose a reason for hiding this comment

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

I am not really sure about the meaning of the record components in an IsObjWithMemory object.
Perhaps we have to document their meaning first.

lib/memory.gi Outdated
slp := a!.slp;
if a!.n = 0 then
if a!.n = 0 or b = 0 then
return ObjWithMemory( slp, 0, a!.el );
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding of a!.el is that it is the group element in question. If b = 0 but a!.n <> 0 then a!.el can be something different from the identity.

lib/memory.gi Outdated
if a!.n = 0 or b = 0 then
return ObjWithMemory( slp, 0, a!.el );
elif b = 1 then
return ObjWithMemory( slp, a!.n, a!.el );
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we simply return a?
The entries in the result of GeneratorsWithMemory are immutable. Do we have situations where objects in IsObjWithMemory are mutable?
(As far as I see, all this is not really documented.)

Avoid enlarging their SLPs when there is no need for it.
@fingolfin fingolfin force-pushed the mh/WithMemory-tweaks branch from 2076f17 to 29f88a2 Compare April 10, 2025 14:03
Copy link
Contributor

@ThomasBreuer ThomasBreuer left a comment

Choose a reason for hiding this comment

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

Looks o.k.

@ThomasBreuer ThomasBreuer merged commit f0b438d into gap-system:master Apr 16, 2025
33 checks passed
@fingolfin fingolfin deleted the mh/WithMemory-tweaks branch April 22, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: library topic: performance bugs or enhancements related to performance (improvements or regressions)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants