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

Feature request: print html tag of the node (not including its children) for lexbor engine #64

Open
gshashank84 opened this issue Aug 18, 2022 · 2 comments

Comments

@gshashank84
Copy link

To check if two nodes are equal, we try to compare the html tag of them. But here the tag of its children also comes in the output. Please add an method that print html string of single node only (i.e. not including its parents).

@gshashank84
Copy link
Author

gshashank84 commented Aug 18, 2022

Also can we make the __eq__ method of LexborNode performant? As we are internally comparing html of the nodes for the equality operator, it takes huge computation time for comparing two nodes of a big tree DOM.

@rushter
Copy link
Owner

rushter commented Aug 19, 2022

Also can we make the __eq__ method of LexborNode performant? As we are internally comparing html of the nodes for the equality operator, it takes huge computation time for comparing two nodes of a big tree DOM.

Yeah, this is an old problem, but there is no easy way to solve it, since lexbor/modest engines do not have internal IDs or something like that to simply compare them. We could compare their location in memory, but we still need to perform a big check in case of a miss. It's also possible to get a race condition when using memory address as the main way to check it.

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

No branches or pull requests

2 participants