Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7967421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:41:44+00:00 2026-06-04T06:41:44+00:00

I have a program which I’m trying to get to work as fast as

  • 0

I have a program which I’m trying to get to work as fast as possible. This program loads a number of different websites and performs some scraping on them.

I used to perform the scraping by using the Forms.HtmlDocument (I basically download it by using WebRequests then I push it into a document using a WebBrowser control) – however that is impossible to parallelise cleanly due to not being able to force the WebBrowser to update when its not the main thread.

So I decided to try out the HtmlAgilityPack, thinking that perhaps I could paralelise that. However then I read the following post:

How to get max performance using Parallel.For/ForEach? (performance timings included)

Which suggests that it doesn’t really paralelise very well.

Converting all the code will take some time (due to the quirks and the complexity of it all) – however I’d like to know whether its worth it or not. If I avoid using WebGet (and instead obtain a stream using WebRequest and push that into the AgilityPack) – will that give me a useful performance increase? Currently it takes about 19 seconds for each iteration, with the majority of time spent waiting for the page to download.

Any other ideas will be considered. Thanks.

EDIT: While we’re here, is there any speed increase with using either method (even in a single-threaded environment?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:41:46+00:00Added an answer on June 4, 2026 at 6:41 am

    For my case htmlagilitypack was working very well. One big issue is RFC compliance that should be overiden when you create srapping applications that run as fast as possible.

    1)Add this at the beggining of your main method

    System.Net.ServicePointManager.DefaultConnectionLimit = 100;
    

    2)Parallelize with normal multithreading library and not tpl.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program which does a system call: latex somefile.latex This runs ok,
I have a program which performs a useful task. Now I want to produce
I'm confused. I have program which I run as a non-administrator user. This program
I have a program which deliberately performs a divide by zero (and stores the
I have a program which only needs a NotifyIcon to work as intended. So
I have a program which looks in source code, locates methods, and performs some
I have this program which worked find in my college lab, but when I
I have program which loads an assembly using Asssembly.LoadFrom method. Some time later I
I have a program which references a DLL. Code in this DLL gets the
I have a program which I would like to run every X min the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.