Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

problem with fcall __pragma__

Aperta
#819 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, python

Direzione di ricerca

Start by reproducing the reported __pragma__ ('fcall') benchmarks in the stated Linux, Python 3.9.6, Transcrypt 3.9.0, and Chrome environment, then inspect the generated JavaScript for update and update_count. The fix is done when the update method uses the py_update alias correctly and the generated behavior matches the intended fcall handling without the reported slowdown.

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

Descrizione

Discovered an issue with __pragma__ ('fcall') when a method is an alias identifier such as update. Using fcall pragma, update_count method performance increased 16% (to 24% after 4M calls), whereas update method performance decreased 2-fold.

class Cls:
    def __init__(self):
        self.count = count
    def update_count(self):
        self.count += 1
cls = Cls()

without __pragma__ ('fcall'):
loop of 1M calls:
1M cls.update_count calls: 0.268s
loop * 4:
1M cls.update_count calls: 0.240s

with __pragma__ ('fcall'):
loop of 1M calls:
1M cls.update_count calls: 0.226s
loop * 4:
1M cls.update_count calls: 0.203s

class Cls:
    def __init__(self):
        self.count = count
    def update(self):
        self.count += 1
cls = Cls()

without __pragma__ ('fcall'):
loop of 1M calls:
1M cls.update calls: 0.258s
loop * 4:
1M cls.update calls: 0.242s

with __pragma__ ('fcall'):
loop of 1M calls:
1M cls.update calls: 0.516s
loop * 4:
1M cls.update calls: 0.528s

The issue is due to incorrectly handling update, which should be aliased py_update. The JS code for the methods with fcall pragma:

update_count method (last arg is 'update_count'):

get update_count () {return __get__ (this, function (self) {
	self.count++;
}, 'update_count');}

update method (last arg is 'update', should be 'py_update'):

get py_update () {return __get__ (this, function (self) {
	self.count++;
}, 'update');}

Environment:
Linux
Python 3.9.6
Transcrypt 3.9.0
Chrome

Lingua principale
Python
Stelle
2.9k
Fork
218
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 TranscryptOrg/Transcrypt

Tutte le issue di TranscryptOrg/Transcrypt

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.