Repository navigation
test(form): benchmark nested FormData-to-JSON conversion - #11280
icecold009 wants to merge 3 commits into
Conversation
Assisted-by: OpenAI Codex
|
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Cyberhet
left a comment
There was a problem hiding this comment.
Thanks for putting this benchmark together! It's super useful to have a reproducible way to track formDataToJSON performance as we iterate on the library.
A couple of small observations:
- Warm-up: As noted by the automated review, a single execution of
formDataToJSON(input)might not be enough to trigger V8's JIT compilation and optimize the function. It might be better to run an untimed warm-up loop ofconversionsiterations before starting the timed samples. - README Output Table: In
scripts/benchmarks/README.md, the expected output forindexed_100anddeep_100describes an array of 100 objects, but actuallyformDataToJSONnests these inside an object according to the root key (e.g.,{ items: [...] }and{ root: { level: { items: [...] } } }respectively). Updating the table would make it exactly match the assertions.
Overall, this is a great addition!
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
PR #11280 - test(form): benchmark nested FormData-to-JSON conversion
Repo: axios/axios Author: @icecold009 Base: v1.x Files: 3 **+123/-0
CI: Unavailable: no checks returned; no build/test workflow result is present in this snapshot. Mergeability: conflicting. Reviewed head: 365a2ccfb3fec41e77a88d2e6f9083dab50cadc7.
Repo Profile
Axios is an npm JavaScript HTTP client for browsers and Node, with XHR/Fetch/HTTP adapters, default and named exports, interceptors, headers/errors, and paired ESM/CJS declarations. The target uses Vitest plus browser and package/module tests; v1 packaging covers older Node CJS runtimes as well as current ESM, Bun and Deno. Contributions preserve transport/security boundaries, add regression coverage and prerelease records, and defer unreleased user docs to PRE_RELEASE_DOCS.md. This review uses the actual target-branch guidance and files, not the separate local v0 checkout.
Verdict
Request changes — No concrete source defect found in this review; the missing latest-head validation and merge conflicts prevent merge approval.
Posted as a comment review for the validation/integration hold; no formal code-change request is implied beyond the specific items below.
Change Explanation And User Impact
This adds a formDataToJSON benchmark covering flat, indexed and deep inputs. It warms each case, measures multiple samples and verifies complete output outside the timed section. The practical effect is a repeatable maintainer workflow for spotting parser cost changes without mixing assertions into the timing. No runtime code or supported API changes. Its results should be interpreted within the printed Node/platform and fixture sizes, not as a universal throughput claim.
Validation scope: source/diff and regression-test review. Examples explicitly marked executed used isolated source snapshots on Node 24.18.0 with the workspace dependency installation; these were focused checks, not a clean install, full CI matrix, or full test-suite run. Author-reported test results were not treated as independently executed.
Competing PRs
Search: axios/axios open PRs, including drafts; full open-list scan plus formDataToJSON in:title,body, 11295 in:title,body, credential redaction in:title,body. Complementary searches were run across related APIs/issues; no query reached the 100-result cap and no search failed. The five explicitly excluded PRs were not reviewed or modified in this batch.
#11296 and #11328 address the same length-slot failure. #11296 uses a narrower guard and has both insertion orders plus browser HTML-form coverage, so it is preferred. #11278 preserves empty field names; #11280 supplies a benchmark; #11299 strengthens hardening tests. Those are complementary. Newly opened #11353 uses the same targeted guard as #11296, with fewer regressions and no prerelease entry; its combined length/nested/dotted cases are covered by #11296.
Preferred PR: No competing implementation supersedes this PR; continue it independently.
Unique contributions: The submitted regression cases protect this specific boundary; preserve them independently of adjacent fixes.
Action: No duplicate closure: the candidates are complementary or no equivalent solution was found.
Project Fit
North star: Reliable HTTP transport and configuration across supported JavaScript environments, without embedding application-specific policy.
Benefits: Provides repeatable parser performance measurements with correctness assertions.
Tradeoffs: Synthetic fixtures improve repeatability but do not model every user form or memory profile.
Fit: Strong — The underlying problem belongs in the transport, serializer, declarations or their maintenance tests.
Adversarial Review
Strongest objection: Synthetic fixtures improve repeatability but do not model every user form or memory profile. Latest-head integration evidence is still needed.
Abuse/failure modes checked: Inspected fixture construction, warm-up, sample/statistic calculation, output validation and environment metadata. Did not run the performance benchmark.
Result: No concrete source defect established in the examined cases; validation and integration limits remain below.
Disposition
Continue
Address the specific blockers below; no unrelated scope or complementary PR should be closed.
Semver
patch — Corrects existing behavior or strengthens internal tooling/tests without adding a public API.
Breaking Changes
None: this is test/tooling-only work or a declaration widening for already-supported runtime behavior.
Documentation
PRE_RELEASE_CHANGELOG.md records the change. No new API reference or migration is required for this scoped correction; keep the release description consistent with the behavior and limits above.
Performance And Regression Risk
Hot path touched: No shipped runtime change.
Performance concern: The benchmark measures a hot parser but does not change it. Timing evidence was not produced by this review.
Regression risk: low — the changed boundary needs regression and integration coverage, particularly after any rebase.
Evidence requested: Reproducible benchmark evidence as described above and the required integration checks.
Blocking Issues
- Latest-head build/test validation is unavailable in the returned GitHub checks. Run or attach the repository build, relevant regression suite and required package/type/browser checks before merge; review/security bots alone do not establish that they pass. This is a validation hold, not an invented source defect.
- GitHub reports merge conflicts with the current target. Resolve them and re-run relevant checks; the reviewed source snapshot is not a tested merge result.
Non-Blocking Suggestions
- Capture before/after runs with the same runtime and machine whenever using this benchmark to justify a parser optimization.
Looks Good
- Inspected fixture construction, warm-up, sample/statistic calculation, output validation and environment metadata. Did not run the performance benchmark.
Summary
Adds a reproducible benchmark for the flat, indexed, and deeply nested FormData-to-JSON workloads requested in #10982. This tooling-only contribution makes no runtime optimization or performance claim.
Linked issue
Closes #10982.
Changes
Validation
Run locally on Windows x64 with Node.js v24.12.0:
node scripts/benchmarks/form-data-to-json.js— passed; all three workloads completed with output and input-preservation assertions.npx.cmd --no-install prettier --check scripts/benchmarks/form-data-to-json.js scripts/benchmarks/README.md PRE_RELEASE_CHANGELOG.md— passed.git diff --check— passed for the local patch.formDataToJSONunit suite passed earlier on this branch (15 tests); it was not rerun for this tooling/docs/changelog amendment.365a2ccfb3fec41e77a88d2e6f9083dab50cadc7, CI, Bundle Size, and GitHub Actions Security Analysis with zizmor areaction_requiredawaiting maintainer approval. GitHub lists 17 required checks as pending; no hosted CI pass is claimed. Automated review checks are separate.Compatibility and documentation
Patch-level Maintenance change. No public API or runtime behavior changes. The benchmark requires native FormData (Node.js 20.19+).
PRE_RELEASE_DOCS.md,index.d.ts,index.d.cts, and type tests are N/A because public behavior and types are unchanged.Checklist
AI assistance: OpenAI Codex assisted with implementation and validation. The current head commit is unsigned, and GitHub blocks merging until commits have verified signatures and a code-owner approval is recorded. The
ai-assistedlabel also still needs a maintainer: the GitHub connector returned 403, and no label control is available in the author browser view.