Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor src/hpc/traverse.c #2102

Merged
merged 6 commits into from
Jan 24, 2018
Merged

Conversation

fingolfin
Copy link
Member

One motivation was to remove the need for putting knowledge about how weak pointer objects work in there, which poses a (minor) complication for PR #2092

It also correct some quirks in the traverse code (e.g. the traversal for immutable lists of cyclotomics and FFEs was not being set before, leading to suboptimal performance), and opens it up for use by kernel extensions.

This code might at some point become interesting for GAP, too. In particular, I'd be curious to test performance for copying objects with it vs. with our current copying code. Of course I expect the current copying code to be faster, but by how much? If it is not too much, I'd investigate switching GAP to this alternate copying code, simply because it is much simpler (and would allow us to get rid of the COPYING tnum trick).

@fingolfin fingolfin added topic: kernel release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Jan 22, 2018
@codecov
Copy link

codecov bot commented Jan 23, 2018

Codecov Report

Merging #2102 into master will increase coverage by 15.34%.
The diff coverage is 77.77%.

@@             Coverage Diff             @@
##           master    #2102       +/-   ##
===========================================
+ Coverage    53.9%   69.24%   +15.34%     
===========================================
  Files         426      489       +63     
  Lines      224155   256303    +32148     
===========================================
+ Hits       120821   177485    +56664     
+ Misses     103334    78818    -24516
Impacted Files Coverage Δ
src/hpc/thread.c 51.48% <ø> (ø)
src/precord.h 96.87% <ø> (+28.69%) ⬆️
src/plist.c 91.17% <100%> (+0.78%) ⬆️
src/precord.c 96.04% <100%> (+7.38%) ⬆️
src/hpc/traverse.c 94.97% <100%> (ø)
src/objects.c 78.73% <100%> (+5.04%) ⬆️
src/weakptr.c 95.42% <100%> (+31.31%) ⬆️
src/objset.c 81.71% <28.57%> (-2.9%) ⬇️
src/funcs.c 78.3% <0%> (-15.61%) ⬇️
lib/random.g 93.33% <0%> (-6.67%) ⬇️
... and 377 more

@fingolfin fingolfin changed the title Refactor src/hpc/traverse.c Refactor src/hpc/traverse.c Jan 23, 2018
Copy link
Member

@markuspf markuspf left a comment

Choose a reason for hiding this comment

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

Except for a minor comment on an "empty" TODO this looks good to me.

I assume we'll add proper tests in your later PR? (Or later full stop)?


//
// TODO
//
Copy link
Member

Choose a reason for hiding this comment

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

What is it that needs to be done?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I wanted to add a comment there explaining what the function does. I'll remove this here, and add that comment in a future PR (I already have a bunch of them which I wrote while trying to understand the traverse code, and fixing some of it)

@fingolfin
Copy link
Member Author

I took care of the TODO comment. As to tests: well, I made sure that we at least test the existing weakptr.tst (it supposedly is flaky?!? resp. depends on "compiler behavior", but so far it seemed fine for me... if it starts causing trouble at some point, we can deal with it then).

And yeah, further improvements are planned for a future PR.

@ChrisJefferson ChrisJefferson merged commit dad20fb into gap-system:master Jan 24, 2018
@fingolfin fingolfin deleted the mh/traverse branch January 24, 2018 20:56
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: kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants