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

Parsing slows down with each subsequent parse

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
performance

調査の方向性

エントリーポイント apertium.Analyzer('eng') とその analyze 呼び出しから始め、次に hfst ベースのパスと比較しながら issue のループを再現します。反復 1000 回目までに、繰り返しの解析が約 0.0009 秒から 0.03 秒へ増加する理由を追跡します。繰り返しの解析が段階的に遅くならなくなれば完了です。

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

説明

Python 3.8.10
apertium-python 0.2.3
apertium 3.8.1
Ubuntu 20.04 (running under WSL)

Reproducing code:

import apertium
import time

i = 0
parser = apertium.Analyzer('eng')
while True:
	then = time.time()
	parser.analyze("Why does this keep getting slower?")
	now = time.time()
	print("Parsing {} took {}".format(i, now - then))
	i += 1

When I run this code, the time taken for the same parse gradually increases. In the first few iterations it takes about 0.0009 seconds per parse, but by iteration 1000 it takes about 0.03 seconds, and it increases from there. Moving parser = apertium.Analyzer('eng') within the loop doesn't solve the problem. If I use the hfst library to run the transducer instead, no slowdown is observed.

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

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

apertium/apertium-python のほかの issue

apertium/apertium-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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