Giter Site home page Giter Site logo

Comments (16)

dgtlmoon avatar dgtlmoon commented on June 12, 2024 2

https://bugs.launchpad.net/lxml/+bug/2059910 it looks like there was some changes to lxml and the minimum level of hardware has changed... it is compiled with some instructions that require a more modern CPU

this fits our pattern - the problem seems to affect people with older CPUs

from changedetection.io.

Tor4nkusu avatar Tor4nkusu commented on June 12, 2024

Same here.
Ubuntu 22.04.4 LTS
Upgraded from 0.45.17 to 0.45.20 and docker image is stuck on "Restarting (132)"

from changedetection.io.

dgtlmoon avatar dgtlmoon commented on June 12, 2024

"The Host OS" which VM solution are you using?

from changedetection.io.

Nekrotza avatar Nekrotza commented on June 12, 2024

Sorry, maybe i expressed myself wrong, i'm not using a VM.

from changedetection.io.

Tor4nkusu avatar Tor4nkusu commented on June 12, 2024

"The Host OS" which VM solution are you using?

I'm on Server 2016 w/ HyperV hosting that ubuntu VM.

from changedetection.io.

dgtlmoon avatar dgtlmoon commented on June 12, 2024

hmm a quick google shows me other projects have the same issue, i have no solution or dont really even know where to start

so if anyone has any ideas... :)

from changedetection.io.

rklos avatar rklos commented on June 12, 2024

Hi, I have the same problem on a dedicated server (no virtualisation) with Ubuntu 22.04.4 LTS and Docker 26.0.2.

edit:
Downgrading to Docker 25 didn't change anything, so it's not a problem with new major Docker release.

from changedetection.io.

Constantin1489 avatar Constantin1489 commented on June 12, 2024

Is this relevant? https://bugs.launchpad.net/lxml/+bug/2063343

from changedetection.io.

dgtlmoon avatar dgtlmoon commented on June 12, 2024

from changedetection.io.

0xuser avatar 0xuser commented on June 12, 2024

I have the same problem, I switched back to version 0.45.17.

from changedetection.io.

Constantin1489 avatar Constantin1489 commented on June 12, 2024

This is follow-up: https://bugs.launchpad.net/lxml/+bug/2059910/comments/16

from changedetection.io.

dgtlmoon avatar dgtlmoon commented on June 12, 2024

This is follow-up: https://bugs.launchpad.net/lxml/+bug/2059910/comments/16

Excellent, so it means lxml 5.2.2 ?

what about this syntax for the requirements.txt?

# 5.2.0 and 5.2.1 had bad CPU flags set causing a crash
lxml >=4.8.0,<6, !=5.2.0, !=5.2.1

from changedetection.io.

Constantin1489 avatar Constantin1489 commented on June 12, 2024

looks good!
image

python3.12 -m pip uninstall lxml && python3.12 -m pip install lxml==5.2.0 && python3.12 -m pip install -r req.txt

from changedetection.io.

Constantin1489 avatar Constantin1489 commented on June 12, 2024

Ah forgot this too. So works

image

from changedetection.io.

dgtlmoon avatar dgtlmoon commented on June 12, 2024

looks good!

@Constantin1489 since 5.2.0/5.2.1 have the extra CFLAGs for better performance on newer CPUs, any chance you can run some of your wonderful speed/benchmark tests on 5.1.9 vs 5.2.0 ?

I'm curious exactly how much faster it is

other thing, would be nice if there was a lxml[modern] pip package where this stuff was set too.. worth asking the maintainer?

from changedetection.io.

Constantin1489 avatar Constantin1489 commented on June 12, 2024

With this shell script, and let's say the file is data/reddit.html

(python3.12 -m pip uninstall lxml -y && python3.12 -m pip install lxml==5.1.1) > /dev/null 2>/dev/null
python3.12 <<EOF
import timeit
setup_code = """
from lxml import etree, html
parser = etree.HTMLParser()
with open('data/reddit.html', 'rb') as f:
    html_bytes = f.read()
"""
code = """
html.fromstring(html_bytes, parser=parser)
"""
print(timeit.timeit(setup=setup_code, stmt=code, number=1000))
EOF

(python3.12 -m pip uninstall lxml -y && python3.12 -m pip install lxml==5.2.0) > /dev/null 2>/dev/null
python3.12 <<EOF
import timeit
setup_code = """
from lxml import etree, html
parser = etree.HTMLParser()
with open('data/reddit.html', 'rb') as f:
    html_bytes = f.read()
"""
code = """
html.fromstring(html_bytes, parser=parser)
"""
print(timeit.timeit(setup=setup_code, stmt=code, number=1000))
EOF

result was

$python3.12 -c 'print((16.555711069027893 - 16.908115033991635)/ 16.908115033991635  * 100)'
-2.0842297574583437

the difference between 5.1.9 and 5.2.0 is so 2%? I'm not that math savvy...

For two.. I don't know..

from changedetection.io.

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.