Investigate slow array-backed object access in jperl
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- performance
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Perl
- Stelle
- 64
- Fork
- 8
- Merge medio
- 5h 44m
- PR unite (30g)
- 203
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fglock/PerlOnJava
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fglock/PerlOnJava#1579 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
fglock/PerlOnJava#1851 ·
I maintainer di solito rispondono entro 1 giorno
-
perf: close method-call throughput gap to blead PerlForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaarea:performance enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
fglock/PerlOnJava#1846 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
fglock/PerlOnJava#1835 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
fglock/PerlOnJava#1820 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fglock/PerlOnJava
Issue simili
-
radius_audit_logs/search returns 500 when the body has no query (nil SearchOp in Vars2.Sql)Forse già presa @fdurand l’ha presa oggi. ApertaType: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
inverse-inc/packetfence#9564 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
LMS-Community/slimserver#1692 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
fix(api): API v3 Product Read ignores request language (lc) for sample products and image URLsForse già presa @muntasir-396 l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
openfoodfacts/openfoodfacts-server#15042 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
libwww-perl/URI#214 ·