Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

problem with fcall __pragma__

Abierto
#819 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
2.9k
Forks
218
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TranscryptOrg/Transcrypt

Todos los issues de TranscryptOrg/Transcrypt

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.