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

kernel: optimize OutNeighbours #281

Merged
merged 1 commit into from
Jan 21, 2020

Conversation

james-d-mitchell
Copy link
Member

@james-d-mitchell james-d-mitchell commented Jan 20, 2020

I'm writing some code that involves a very large number of calls to the homomorphism finding code for relatively small digraphs. One things that stood out when profiling that code was that DigraphNrVertices uses more time than maybe necessary. This PR optimises the C code for DigraphNrVertices.

In the stable-1.0 branch:

gap> D := CompleteDigraph(2);;
gap> for i in [1 .. 100000] do
> HomomorphismDigraphsFinder(D, D, fail, [], 1, 2, 0, [1, 2],
> [], [[1, 2]], [[1, 2]]);
> od;
gap> time;
1205

with this PR:

gap> D := CompleteDigraph(2);;
gap> for i in [1 .. 100000] do
> HomomorphismDigraphsFinder(D, D, fail, [], 1, 2, 0, [1, 2],
> [], [[1, 2]], [[1, 2]]);
> od;
gap> time;
1073

a modest saving, but a saving nonetheless.

@james-d-mitchell james-d-mitchell added the enhancement A label for PRs that provide enhancements. label Jan 20, 2020
@james-d-mitchell james-d-mitchell mentioned this pull request Jan 20, 2020
@james-d-mitchell james-d-mitchell merged commit 87e4bc2 into digraphs:stable-1.0 Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A label for PRs that provide enhancements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants