Investigate slow array-backed object access in jperl
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Perl
- Star
- 64
- Fork
- 8
- Merge trung bình
- 5 giờ 28 phút
- Pull request đã merge (30 ngày)
- 199
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fglock/PerlOnJava
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#1579 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:runtime bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
fglock/PerlOnJava#1859 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
fglock/PerlOnJava#1851 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
perf: close method-call throughput gap to blead PerlCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea:performance enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
fglock/PerlOnJava#1846 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
fglock/PerlOnJava#1835 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fglock/PerlOnJava
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
radius_audit_logs/search returns 500 when the body has no query (nil SearchOp in Vars2.Sql)Có thể đã có người làm @fdurand đã nhận 1 ngày trước. Đang mởType: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
inverse-inc/packetfence#9564 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
LMS-Community/slimserver#1692 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(api): API v3 Product Read ignores request language (lc) for sample products and image URLsCó thể đã có người làm @muntasir-396 đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
openfoodfacts/openfoodfacts-server#15042 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày