Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

problem with fcall __pragma__

オープン
#819 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
2.9k
フォーク
218
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TranscryptOrg/Transcrypt のほかの issue

TranscryptOrg/Transcrypt の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。