Coder Social home page Coder Social logo

Performance issues about scraper HOT 4 CLOSED

causal-agent avatar causal-agent commented on June 25, 2024
Performance issues

from scraper.

Comments (4)

teymour-aldridge avatar teymour-aldridge commented on June 25, 2024 4

I don't think so – unless this is something that scraper is doing wrong (rather than html5ever) – if you try that example with html5ever directly (scraper is just a set of convenience wrappers over https://github.com/servo/html5ever) do you find that there is an increase in speed?

Apart from this you might find that using a multiprocessing library such as rayon could speed up your program drastically.

from scraper.

let4be avatar let4be commented on June 25, 2024 4

Time spent per page is completely within normal bounds I'd expect,

I'm currently working on a toy project - implementing broad web crawler in rust, here is one curious stat(ran on i9 10900k, each CPU will have this a bit different)
example

What you need to do is use multiple threads either via rayon or directly with std::thread

from scraper.

nathaniel-daniel avatar nathaniel-daniel commented on June 25, 2024 3

If you only care about parsing and if the data you extract is simple enough, you might have better luck with lol-html.

from scraper.

teymour-aldridge avatar teymour-aldridge commented on June 25, 2024 2

What @nathaniel-daniel said, and also it's not unexpected that in that program that parsing would take 97% of the running time of your program, given that your program is primarily parsing (with a little io). As for the 9ms figure, that seems fine – how big are your documents?

from scraper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.