Title: Extra allocations in `*TextFormatWriter` because of Java 8 target · Issue #2075 · prometheus/client_java · GitHub
Open Graph Title: Extra allocations in `*TextFormatWriter` because of Java 8 target · Issue #2075 · prometheus/client_java
X Title: Extra allocations in `*TextFormatWriter` because of Java 8 target · Issue #2075 · prometheus/client_java
Description: See this line of code: client_java/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java Line 412 in fa68aa7 writeName(writer, name + (suffix != null ? suffix : "...
Open Graph Description: See this line of code: client_java/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java Line 412 in fa68aa7 writeName(wri...
X Description: See this line of code: client_java/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java Line 412 in fa68aa7 writeName(wri...
Opengraph URL: https://github.com/prometheus/client_java/issues/2075
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Extra allocations in `*TextFormatWriter` because of Java 8 target","articleBody":"See this line of code:\n\nhttps://github.com/prometheus/client_java/blob/fa68aa7789c53d54ea1783f120194a3feae7e7b8/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java#L412\n\nBecause of the Java 8 target, the string concatenation gets compiled to something like `new StringBuilder().append(name).append(suffix).toString()`, which allocates the memory at least twice (for the buffer in the `StringBuilder` and for the resulting string).\n\nIf the code was compiled for at least Java 9, it would use `StringConcatFactory`, which in this case would allocate the memory only for the resulting string.\n\nWould the maintainers consider publishing multiple artifacts for different Java targets, or using multi-release JARs for the purpose of this and similar optimizations?","author":{"url":"https://github.com/m-burst","@type":"Person","name":"m-burst"},"datePublished":"2026-04-29T15:37:41Z","url":"https://github.com/prometheus/client_java/issues/2075"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3590032a-0b34-ccc6-566c-7201c3cf316f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF34:96C99:100EFF:15E27B:6AFBA947 |
| html-safe-nonce | c7eac7c53d8b526beec707803b9158fd765ffffc1b3431fcc0f1b453d12707d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjM0Ojk2Qzk5OjEwMEVGRjoxNUUyN0I6NkFGQkE5NDciLCJ2aXNpdG9yX2lkIjoiMzk5NDI3NTE3NzExMzAzNzEyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 241cb12a2333dce2ad37a9f1c73e916fb4e1fd4cb86868da2967f67e2517a3d6 |
| hovercard-subject-tag | issue:4351803062 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/prometheus/client_java/2075/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6a5e59d593553368cd50b5e02bae660797b1a10c14dc1ce8de0f86066a3de4e8/prometheus/client_java/issues/2075 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6a5e59d593553368cd50b5e02bae660797b1a10c14dc1ce8de0f86066a3de4e8/prometheus/client_java/issues/2075 |
| og:image:alt | See this line of code: client_java/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java Line 412 in fa68aa7 writeName(wri... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | m-burst |
| hostname | github.com |
| expected-hostname | github.com |
| None | 03e5090f0cea887cafa036e3af34d7c668d83b5e9e9e03df72a90efb49b69cdf |
| turbo-cache-control | no-preview |
| go-import | github.com/prometheus/client_java git https://github.com/prometheus/client_java.git |
| octolytics-dimension-user_id | 3380462 |
| octolytics-dimension-user_login | prometheus |
| octolytics-dimension-repository_id | 7997879 |
| octolytics-dimension-repository_nwo | prometheus/client_java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7997879 |
| octolytics-dimension-repository_network_root_nwo | prometheus/client_java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 41f00295b9a35dca977890ab83b22788ab211dc8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width