python [9217175f]
Tags: computers
Context sensitivity: groups.google.com/g/comp.theory/c/nJzOyRnAP3k/m/AInZxo48FNIJ?pli=1
1. Performance Python
1. Performance Python
1.1. Vectorcall
1.1. Vectorcall
- peps.python.org/pep-0590/
- C API to optimize calling of objects
-
tp_calltoo slow- Also one function pointer per class, rather than per object. So classes create a lot of intermediate objects
2. Cpython
2. Cpython
- Every object is defined by a C struct called
PyTypeObject. This struct contains slots.
3. Parsing PDF's in Python
3. Parsing PDF's in Python
-
You can use:
pypdf.orpypdf4-
pdfminer- also
pypdfparser
- also
textract-> textract.readthedocs.io/en/stable/python_package.htmlpoppler-> pdf rendering engine?- OCR ->
tesseractwithpytesseract, preprocess withopencv tika.with the pythontikainterface
4. Difflib
4. Difflib
- docs.python.org/3/library/difflib.html
-
generates diffs
-
has a series of diffs that allow for fleixible computing of sequences including:
- html
- pure strings (
get_close_matches) - number type diffs
-
5. OS
5. OS
-
CPU Count:
- docs.python.org/3/library/os.html#os.cpu_count
- docs.python.org/3/library/os.html#os.sched_getaffinity is not available on all platforms
6. Discussion Forum Changing from Mailing List
6. Discussion Forum Changing from Mailing List
-
- Scattered community upon mailing lists, was scattered between PR's, Issues, python-dev, python-committers, etc
- Unification on Discourse
7. Python Concurrency
7. Python Concurrency
-
superfastpython.com/python-concurrency-choose-api/
- Coroutine (asyncio) vs thread (threading) vs process (multiprocessing)