Comments (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.
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)
What you need to do is use multiple threads either via rayon
or directly with std::thread
from scraper.
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.
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)
- user needs to add selectors crate to Cargo.toml in order to use add_class
- no method named `next_sibling_element` found for struct `ElementRef<'_>` in the current scope HOT 2
- Over 60x performance increase with html.tree.root().traverse() and ego tree walk HOT 2
- Remove Cargo.lock HOT 2
- Disable logging? HOT 2
- Select inside <noscript> HOT 3
- how to remove the node? HOT 1
- How to select in pairs? HOT 1
- How to get the number from NodeID HOT 6
- same element? HOT 3
- Allow `Selector` to be const-creatable HOT 3
- Save source code `ElementRef::html()` HOT 3
- Malformed HTML parsed differently from browsers
- Make element traversal more convenient HOT 2
- [Feature Request] Find by Text HOT 1
- Dom Nodes closes prematurely on recursion
- How to select contains and start with? HOT 1
- any way to scrape in a stream? HOT 2
- Support for `:has()` selector HOT 4
- Implement Send for ElementRef HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scraper.