-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Milestone
Description
Summary
When using LazySegtree in the AtCoder Library Practice Contest, the program consumes a large amount of memory and results in TLE (Time Limit Exceeded). This issue is particularly noticeable when running under Scala Native.
Observed Behavior
Environment:
AtCoder 2023/1 Language Update - Google スプレッドシート
- Scala 3.3.0 (Scala Native 0.4.14)
- Scala (Dotty 3.3.0)
- openjdk-20-jdk-headless
Contest tasks
Submissions
K - Range Affine Range Sum
- https://atcoder.jp/contests/practice2/submissions/46781423
- Dotty 3.3.0 / 4972 ms / 294588 KiB
- https://atcoder.jp/contests/practice2/submissions/70007496
- Scala Native 0.4.14 / 5620 ms / 1396188 KiB
| case | result | time | memory |
|---|---|---|---|
| max_random_00 | TLE | 5620 ms | 1393420 KiB |
| max_random_01 | TLE | 5617 ms | 1375172 KiB |
| max_random_02 | TLE | 5614 ms | 1396188 KiB |
| random_00 | TLE | 5616 ms | 1319488 KiB |
| random_01 | TLE | 5613 ms | 1302620 KiB |
| random_02 | AC | 3710 ms | 842776 KiB |
(reference) L - Lazy Segment Tree
- https://atcoder.jp/contests/practice2/submissions/46865651
- Dotty 3.3.0 / 1590 ms / 149388 KiB
- https://atcoder.jp/contests/practice2/submissions/70007637
- Scala Native 0.4.14 / 935 ms / 286028 KiB
Hypotheses
- Memory leak in Scala Native generated code
Steps to Reproduce
Tasks
- Reproduce and confirm the issue
- Run profiling (JMH, async-profiler, etc.)
- Identify bottleneck
- Propose optimization approach
- Benchmark optimized version
- Create pull request
Related
- Specialization for Scala 3 scala/scala3#18044
- Runtime / Garbage Collector Settings — Scala Native 0.5.9 documentation
- 新ジャッジ運用開始のお知らせ - AtCoder
- AtCoder言語アップデート2024-2025 - Google スプレッドシート
Notes
Previously, the AtCoder administrators uploaded the test cases for the AtCoder Library Practice Contest to Dropbox for me, but the public access has been temporarily suspended, so the test data is currently unavailable.
Metadata
Metadata
Assignees
Labels
No labels