René's URL Explorer Experiment


Title: IntelliJ plugin: format in the IDE's JVM, without a new JVM for each call · Issue #223 · openjavaformat/open-java-format · GitHub

Open Graph Title: IntelliJ plugin: format in the IDE's JVM, without a new JVM for each call · Issue #223 · openjavaformat/open-java-format

X Title: IntelliJ plugin: format in the IDE's JVM, without a new JVM for each call · Issue #223 · openjavaformat/open-java-format

Description: What happens The IntelliJ plugin formats in one of two ways. With the Java-based formatter, BootstrappingFormatterService starts a new JVM for every Reformat; with the native binary, NativeImageFormatterService starts the binary. Either ...

Open Graph Description: What happens The IntelliJ plugin formats in one of two ways. With the Java-based formatter, BootstrappingFormatterService starts a new JVM for every Reformat; with the native binary, NativeImageFor...

X Description: What happens The IntelliJ plugin formats in one of two ways. With the Java-based formatter, BootstrappingFormatterService starts a new JVM for every Reformat; with the native binary, NativeImageFor...

Opengraph URL: https://github.com/openjavaformat/open-java-format/issues/223

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"IntelliJ plugin: format in the IDE's JVM, without a new JVM for each call","articleBody":"### What happens\n\nThe IntelliJ plugin formats in one of two ways. With the Java-based formatter, `BootstrappingFormatterService` starts a new JVM for every Reformat; with the native binary, `NativeImageFormatterService` starts the binary. Either way each call pays for a process, and an import optimizer (#222) would pay it again, inside a read action.\n\nTimes of one call on JDK 21, macOS aarch64, with 21.0.2:\n\n| How the formatter runs | `JavaInputAstVisitor.java`, 4,026 lines | A 5-line file |\n|---|---|---|\n| A new JVM for each call (today's Java-based mode) | 0.97 s | 0.3 s |\n| Native binary | 0.28 s | 0.02 s |\n| In the IDE's JVM, first call | 0.65 s | |\n| In the IDE's JVM, warm (median of 30) | 124 ms to format, 9 ms for `fixImports` | |\n\n### How google-java-format does it\n\nIt formats in the IDE's own JVM, never in a process of its own. Its README asks users to add six `--add-exports jdk.compiler/...=ALL-UNNAMED` lines to the IDE's VM options, and `JreConfigurationChecker` shows those instructions when the javac classes cannot be reached.\n\n### Formatting in the IDE's JVM without editing VM options\n\nIntelliJ IDEA 2024.2.6 starts its JVM with, among the `additionalJvmArguments` of its `product-info.json`, `--add-opens=java.base/java.lang=ALL-UNNAMED` and `--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED`. With `java.lang` open, a plugin can call `Module.implAddExports` and export the javac packages the formatter needs to the class loader it loads the formatter into. Tried in a JVM started with those two flags only, not in a running IDE yet: the formatter loaded into a `URLClassLoader` of its own formatted the file above byte for byte as the command line does, at the times in the table.\n\n### Proposal\n\nLet the plugin run the formatter in the fastest way available, falling back to the next:\n\n1. **In the IDE's JVM**, when the javac packages can be exported to the formatter's class loader, or already are. One class loader per formatter version, as `FormatterServiceLoader` in the Gradle plugin keeps one per set of jars. A formatter bug then happens inside the IDE, and the javac of the IDE's runtime decides which syntax parses, as it does today.\n2. **A formatter daemon**, as Gradle has one: a JVM per formatter version that stays up and takes files over its standard input. As fast as the in-process mode once warm, isolated from the IDE, and free to run on a newer JDK than the IDE's. It needs a server mode in `Main`, a protocol, restarts and cleanup. Worth it only if the in-process mode turns out not to work.\n3. **The native binary**, as today. No JVM to start, slower than warm JIT-compiled code on big files, and its parser is the one of GraalVM 25.\n4. **A new JVM for each call**, as today, when nothing else is possible.\n\n### Open questions\n\n- `Module.implAddExports` is not public API; if JetBrains stops opening `java.lang`, the plugin falls back to the next mode.\n- Which mode the plugin's settings show and which it picks by itself.\n","author":{"url":"https://github.com/abashev","@type":"Person","name":"abashev"},"datePublished":"2026-11-13T20:35:47Z","url":"https://github.com/openjavaformat/open-java-format/issues/223"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a71612c9-6b69-5796-d8f7-cf0cc0edd4a1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD788:6188:2BB2B2:39FEDE:6AFBB795
html-safe-nonce5117f0a8985b2624a0671762a47e8d4bb01e4db1f63a87bba0deda5415fb35af
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzg4OjYxODg6MkJCMkIyOjM5RkVERTo2QUZCQjc5NSIsInZpc2l0b3JfaWQiOiIyNjgyODgyMjQyNzEwODQ1MzMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac41821bc96bc93ff0aa8c24302bd7e3e5b701c894a6e618ff5a226646c882e49d
hovercard-subject-tagissue:6379505672
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/openjavaformat/open-java-format/223/issue_layout
twitter:imagehttps://opengraph.githubassets.com/511d57952ece20d1ca63b281bf101dcbdff1ff122553f0950bc5da3ef4429fc5/openjavaformat/open-java-format/issues/223
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/511d57952ece20d1ca63b281bf101dcbdff1ff122553f0950bc5da3ef4429fc5/openjavaformat/open-java-format/issues/223
og:image:altWhat happens The IntelliJ plugin formats in one of two ways. With the Java-based formatter, BootstrappingFormatterService starts a new JVM for every Reformat; with the native binary, NativeImageFor...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameabashev
hostnamegithub.com
expected-hostnamegithub.com
None2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c
turbo-cache-controlno-preview
go-importgithub.com/openjavaformat/open-java-format git https://github.com/openjavaformat/open-java-format.git
octolytics-dimension-user_id325177626
octolytics-dimension-user_loginopenjavaformat
octolytics-dimension-repository_id1288055459
octolytics-dimension-repository_nwoopenjavaformat/open-java-format
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id214273098
octolytics-dimension-repository_parent_nwopalantir/palantir-java-format
octolytics-dimension-repository_network_root_id214273098
octolytics-dimension-repository_network_root_nwopalantir/palantir-java-format
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee4cce0e99cf61481a318ff12c2e8580153a6c7c6
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/openjavaformat/open-java-format/issues/223#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fissues%2F223
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fissues%2F223
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=openjavaformat%2Fopen-java-format
Reloadhttps://github.com/openjavaformat/open-java-format/issues/223
Reloadhttps://github.com/openjavaformat/open-java-format/issues/223
Reloadhttps://github.com/openjavaformat/open-java-format/issues/223
openjavaformathttps://github.com/openjavaformat
open-java-formathttps://github.com/openjavaformat/open-java-format
Codehttps://github.com/openjavaformat/open-java-format
Issues30 (30)https://github.com/openjavaformat/open-java-format/issues
Pull requests5 (5)https://github.com/openjavaformat/open-java-format/pulls
Discussionshttps://github.com/openjavaformat/open-java-format/discussions
Actionshttps://github.com/openjavaformat/open-java-format/actions
Security and qualityhttps://github.com/openjavaformat/open-java-format/security
Insightshttps://github.com/openjavaformat/open-java-format/pulse
https://github.com/openjavaformat/open-java-format
New issuehttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/223
New issuehttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/223
IntelliJ plugin: format in the IDE's JVM, without a new JVM for each callhttps://github.com/openjavaformat/open-java-format/issues/223#top
enhancementNew feature or requesthttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/abashev
abashevhttps://github.com/abashev
on Nov 13, 2026https://github.com/openjavaformat/open-java-format/issues/223#issue-6379505672
#222https://github.com/openjavaformat/open-java-format/issues/222
abashevhttps://github.com/abashev
enhancementNew feature or requesthttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Nov 13, 2026https://github.com/openjavaformat/open-java-format/issues/223#event-36071708451
Sign up for freehttps://github.com/signup?return_to=https://github.com/openjavaformat/open-java-format/issues/223
Sign in to commenthttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/223
enhancementNew feature or requesthttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.