problem with fcall __pragma__
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, python
- 領域
- compilers, performance
調査の方向性
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 はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TranscryptOrg/Transcrypt のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
TranscryptOrg/Transcrypt#913 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
TranscryptOrg/Transcrypt#911 · コメント 2 件 ·
-
IS: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
TranscryptOrg/Transcrypt#908 ·
-
SUB: documentation
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
TranscryptOrg/Transcrypt#656 · コメント 7 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
TranscryptOrg/Transcrypt#914 ·
TranscryptOrg/Transcrypt の issue をすべて見る
似ている issue
-
essnmx good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
[Feature] 奇物选择添加优先级 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
syfoud/Simulated_Scepter#174 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Giskard-AI/giskard-oss#2840 · コメント 1 件 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success オープンarea: repo bug perceived difficulty: 2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
yeti-platform/yeti#1380 ·