Hacker News new | ask | show | jobs
by punnerud 2189 days ago
time python3 solver.py fred.cnf

Took 9min and 10seconds on RPi 3 running Ubuntu 20.04. Consuming 100% CPU and 1% RAM (1024MB).

1 comments

This is actually amazing. My python programs rarely run at 100% cpu, whereas C++ binaries are usually up there. Always thought python's inefficiency causes the drop in cpu utilization.
I don't know about how efficient it is but I have always been able to peg all cores with the multiprocessing module. Even something useless like "x * x" is more then enough for 800%.
Python's regex implementation is probably not written in Python, so while it's trying to match, no Python code runs; it's all /C(++)?/.