-
-
Notifications
You must be signed in to change notification settings - Fork 295
Lazy fields parsing #2072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
poslegm
wants to merge
27
commits into
scalapb:master
Choose a base branch
from
poslegm:fresh-benchmarks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Lazy fields parsing #2072
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4422797
benchmarks revived
poslegm 59e46a9
LargeStringMessage benchmark
poslegm 883e647
LargeNestedStringMessage benchmark
poslegm e91ca8c
LargeByteMessage benchmark
poslegm 6933a04
LargeByteMessage benchmark result
poslegm 1d101fb
LazyField naive impl
poslegm c74bba3
tests on repeated and decode counter
poslegm f262578
recursive test
poslegm a8a8898
agents md upgrade
poslegm 0aa73f9
java protobuf generation for lazy fields
poslegm b89faeb
lazy large nested string message benchmarks (works well!)
poslegm 5d30ff6
equals and implicit conversions
poslegm d13e289
scala 2/3 compat for lazy field conversions
poslegm cc1ec1a
formatting
poslegm 2d26e77
Documentation + equality clarification
poslegm 2248c4f
equality warning
poslegm ba6d59b
lenses test
poslegm a0ec34c
fmt
poslegm 3bb5bda
benchmarks
poslegm 4e32bc6
Generated code
poslegm 0d13acf
implicit conversions for repeated and map fields
poslegm ad11421
Round-trip benchmark
poslegm ca97611
update docs
poslegm a9f118c
benchmark results clear
poslegm 1309ba2
benchmark results
poslegm 4edbae5
fixed snapshot version
poslegm be6b72f
Java conversion test
poslegm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # Agents | ||
|
|
||
| This file contains instructions for agents working on this project. | ||
|
|
||
| ## Mindset | ||
|
|
||
| **sbt is slow—minutes per compile/test.** Wasted cycles waste hours. | ||
|
|
||
| - **Batch edits.** Do not: edit → compile → edit → compile. Do: edit everything → compile once. | ||
| - **Design tests with code.** Cover every statement and branch; if coverage reveals gaps, fix all at once. | ||
| - **Extreme ownership.** "Optional" means required; do the work completely. | ||
|
|
||
| ## Commands | ||
|
|
||
| ```bash | ||
| # Discover project names and Scala versions | ||
| sbt projects | ||
| sbt e2eJVM2_12/test | ||
| sbt e2eJVM2_13/test | ||
| sbt e2eJVM3/test | ||
| ``` | ||
|
|
||
| ## Workflow | ||
|
|
||
| Phases 1-3 repeat until verify passes. Phase 4 runs once at the end. | ||
|
|
||
| ### 1. Edit | ||
| Batch code and tests together. For large changes, split into batches—each batch includes its tests. | ||
|
|
||
| ### 2. Fast Loop | ||
| One project, one Scala version: get `<project>/test` green. Default Scala 3; use Scala 2 if editing `scala-2/` sources. No coverage here. | ||
|
|
||
| ### 3. Verify | ||
| Enter only when fast loop is green. Run in order: | ||
|
|
||
| 1. **Coverage** — Scala version you developed with | ||
| 2. **Cross-Scala** — the other Scala version, same project | ||
| 3. **Cross-platform** — other platform projects, if cross-built and you touched shared/ or platform sources | ||
|
|
||
| If any step fails: return to phase 1, fix, get green in phase 2, rerun the failing step. | ||
|
|
||
| ### 4. Format | ||
|
|
||
| Run once after verify passes. | ||
|
|
||
| ## Boundaries | ||
|
|
||
| ### Always | ||
| - Follow workflow phases in order | ||
| - Batch edits; keep sbt runs scoped to one project | ||
| - Update AGENTS.md if you find errors or gaps | ||
| - Document new data types in `docs/`; update existing docs when behavior changes | ||
| - **README.md is auto-generated.** Never edit `README.md` directly. Edit `docs/index.md` instead, then run `sbt --client generateReadme` to regenerate `README.md`. | ||
|
|
||
| ### Ask First | ||
| - Adding dependencies (even test-only) | ||
| - Creating or removing subprojects | ||
| - Any repo-wide test or coverage run | ||
| - **New modules:** When adding a new module, update the `testJVM`, `testJS`, `docJVM`, and `docJS` command aliases in `build.sbt`. | ||
|
|
||
| ### Never | ||
| - Use coverage as starting point for test design (think first, verify with coverage) | ||
| - Iterate coverage in tiny steps (if gaps exist, fix ALL at once, then rerun once) | ||
| - Cheat: delete code/tests, lower thresholds, or game metrics to appear compliant | ||
| - Retest after formatting (unless formatting broke the build) | ||
| - Use `sbt test` (repo-wide) when `sbt <project>/test` works | ||
| - Call work "optional" or "good enough" to justify not doing it | ||
|
|
||
| ## Benchmarks | ||
|
|
||
| To run the benchmarks, navigate to the `benchmarks` directory and run the following command: | ||
|
|
||
| ```bash | ||
| amm run_benchmarks.sc --scalapb <scalapb_version> --scala <scala_version> --java <true|false> --mode <fast|full> --benchmarks <benchmark_name> | ||
| ``` | ||
|
|
||
| For example: | ||
|
|
||
| ```bash | ||
| amm run_benchmarks.sc --scalapb 0.11.20 --scala 2.13.18 --java true --mode fast --benchmarks LargeStringMessage | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Benchmarks | ||
|
|
||
| ## How to run | ||
|
|
||
| Execute `run_benchmarks.sc` with [ammonite](https://ammonite.io/): | ||
|
|
||
| ```bash | ||
| amm run_benchmarks.sc --help | ||
| ``` | ||
|
|
||
| Example: | ||
|
|
||
| ```bash | ||
| amm run_benchmarks.sc --scalapb 0.11.20 --scala 2.13.18 --java false | ||
| ``` | ||
|
|
||
| Runs all benchmarks for scalapb version 0.11.20 and Scala version 2.13.18 without java benchmarks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can delete it if it is not necessary.