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

Make url check concurrent #506

Merged
merged 1 commit into from
Jan 9, 2017
Merged

Conversation

clample
Copy link
Contributor

@clample clample commented Jan 5, 2017

Resolves #479

@clample
Copy link
Contributor Author

clample commented Jan 5, 2017

I built the example site and added 50 external links from hacker news: Sample Markdown

I ran the link checker against the sample site to see if these changes actually improved performance. I ran the link check 10 times with the concurrent link check and 10 times with master. The average time improved from 27.2 seconds to 20.5 seconds.

Actual results:

With concurrency:

13.882
13.807
16.456
13.639
14.385
15.356
20.795
28.657
40.384
27.241

average: 20.4602

Master (without concurrency):

17.040
30.740
29.492
32.440
27.697
25.157
26.285
30.854
23.844
28.244

average: 27.1793

@clample
Copy link
Contributor Author

clample commented Jan 5, 2017

I might also have time to add tests (we'll see)

#else
checkExternalUrl _ = return ()
checkExternalUrl url = skip url Nothing
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do skip to make sure we eventually write to the MVar. Otherwise I believe that there's an error

@jaspervdj
Copy link
Owner

Looks good to me 👍 (although I think this could be simplified a bit by just using an IORef instead of an MVar).

Can I merge this in or do you want to add additional work?

@clample
Copy link
Contributor Author

clample commented Jan 8, 2017

Cool! (I didn't know what an IORef is but I'll check it out).

You're welcome to merge this

@jaspervdj jaspervdj merged commit 9770dd9 into jaspervdj:master Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants