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

Investigate slow array-backed object access in jperl

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java, perl
領域
performance

調査の方向性

Start with dev/bench/benchmark_method.pl and run the hash-backed and array-backed variants in fresh PerlOnJava processes, as described. Then profile the method-call workload and trace generated JVM code and runtime helpers for field reads and updates; compare JVM and interpreter backends. Done means the performance gap is localized, with a focused benchmark or regression check added and an optimization that preserves Perl semantics.

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

説明

Summary

Investigate why array-backed objects are substantially slower than hash-backed objects in PerlOnJava for repeated method calls and field updates. The same benchmark shows a small array advantage in system Perl, so this appears to be a PerlOnJava implementation-path difference rather than an inherent cost of Perl array objects.

Reproduction

Run dev/bench/benchmark_method.pl, which performs 500 Benchmark iterations of a method called 20,000 times per iteration. Foo::add reads and increments $self->{x} and $self->{y}, then returns their sum.

For the array-backed variant, replace construction with bless [ 1, 2 ], $class, and change the field accesses to $self->[0] and $self->[1].

Both variants completed successfully and printed the same final value: done 399600080000.

Observed performance

Reported by Perl's Benchmark::timethis (iterations/second; larger is faster):

Runtime Hash-backed Array-backed Difference
System Perl 329–330/s 359–360/s array ~9% faster
PerlOnJava (jperl) 264–268/s 89–91/s array ~66% slower

The PerlOnJava result was repeated twice after the initial run and was consistent. Each PerlOnJava run was executed in a fresh process.

Investigation goals

  • Profile the benchmark to separate method dispatch, argument setup, scalar arithmetic, hash access, and array access costs.
  • Trace generated JVM code and runtime helpers for $self->{key} versus $self->[index], including lvalue fetch/store paths.
  • Determine whether array access allocates or copies wrappers, performs redundant bounds/type checks, or takes a slower generic path.
  • Compare JVM and interpreter backends to localize the issue.
  • Add a focused benchmark or regression performance check once the hot path is understood, then optimize without changing Perl semantics.

Caveats

This is a microbenchmark of the complete method-call path, not an isolated container benchmark. The result does not prove hash access is optimal; it shows that this workload currently favors hash-backed objects in PerlOnJava. More controlled access-only benchmarks and profiling are needed before attributing the gap to a specific implementation component.

主要言語
Perl
スター
64
フォーク
8
平均マージ
5時間 28分
マージ済み PR(30日)
199

環境構築

はじめの一歩

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

fglock/PerlOnJava のほかの issue

fglock/PerlOnJava の issue をすべて見る

似ている issue

Perl の issue をもっと見る

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

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