Restore (or beat) Python 2 performance for arithmetic operations on ints that fit into a single word

Aperta
#101,291 7 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia con la discussione più approfondita in faster-cpython/ideas#548, quindi esamina le pull request collegate gh-101292, gh-101685, gh-102464, gh-104742, gh-104759, gh-107388, gh-107392, gh-125384, gh-125407 e gh-125408. Il lavoro sarà completato quando un nuovo layout degli oggetti int/long ripristinerà o supererà le prestazioni di Python 2 per l’aritmetica su interi a una sola parola.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

interpreter-core performance

In Python 2 ints and longs were different objects, and the design of each was tailored to the different size and use cases.
In Python3 we dropped the distinction, but we also dropped the design for ints that fit into a single word.
We have added various fast paths for "medium" integers (e.g. https://github.com/python/cpython/issues/89109) but the underlying data structure gets in the way.

We should layout the int/long object so that it supports fast operations for most integers.

See https://github.com/faster-cpython/ideas/issues/548 for a fuller discussion

Linked PRs
  • gh-101292
  • gh-101685
  • gh-102464
  • gh-104742
  • gh-104759
  • gh-107388
  • gh-107392
  • gh-125384
  • gh-125407
  • gh-125408
Lingua principale
Python
Stelle
77.2k
Fork
36k
Merge medio
1g 9h
PR unite (30g)
558

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python/cpython

Tutte le issue di python/cpython

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.