Title: Logger/string formatting slows down some calculations · Issue #789 · biojava/biojava · GitHub
Open Graph Title: Logger/string formatting slows down some calculations · Issue #789 · biojava/biojava
X Title: Logger/string formatting slows down some calculations · Issue #789 · biojava/biojava
Description: Calculating secondary structure of 4hhb 10000 times takes 589 seconds on my machine. If the following two lines are commented out, it takes 34 seconds: biojava/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucC...
Open Graph Description: Calculating secondary structure of 4hhb 10000 times takes 589 seconds on my machine. If the following two lines are commented out, it takes 34 seconds: biojava/biojava-structure/src/main/java/org/b...
X Description: Calculating secondary structure of 4hhb 10000 times takes 589 seconds on my machine. If the following two lines are commented out, it takes 34 seconds: biojava/biojava-structure/src/main/java/org/b...
Opengraph URL: https://github.com/biojava/biojava/issues/789
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Logger/string formatting slows down some calculations","articleBody":"Calculating secondary structure of 4hhb 10000 times takes 589 seconds on my machine. If the following two lines are commented out, it takes 34 seconds:\r\n\r\nhttps://github.com/biojava/biojava/blob/8a7b651afc1bd75bf70f03d309250058a45b982d/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L851-L856\r\n\r\nhttps://github.com/biojava/biojava/blob/8a7b651afc1bd75bf70f03d309250058a45b982d/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L869-L870\r\n\r\nThe problem is likely to be in the String.format method. Using SLF4J parameterized messages instead (\"{}\") is much faster, but does not support float formatting to number of decimal places (see https://stackoverflow.com/questions/22720865/formatting-floating-point-numbers-in-slf4j, thanks @josemduarte ).\r\n\r\nMy suggestion is to go through the logging messages which use string formatting and, if feasible, change them to parameterized messages. \r\n\r\nThe performance is noticeably affected only if the logging statements are somewhere deep within a loop.","author":{"url":"https://github.com/biocryst","@type":"Person","name":"biocryst"},"datePublished":"2018-08-07T23:17:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/789/biojava/issues/789"}
| 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:6bc3adb6-1e70-052b-5e72-a56c8547ecfa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CBA6:18F725:3F47630:5611CC6:6972EE77 |
| html-safe-nonce | babe5ec6babd0f639f3cfb14c541a6c6d070296403b35a785c51d4d4ef05e00a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkE2OjE4RjcyNTozRjQ3NjMwOjU2MTFDQzY6Njk3MkVFNzciLCJ2aXNpdG9yX2lkIjoiMTg1MzU4MDQwMzUwMzQ1OTk1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d0e1b7a47123dafeb390ea68152c8781cd3c7e1e9e9b624f31112d5d1e28e958 |
| hovercard-subject-tag | issue:348519951 |
| 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/biojava/biojava/789/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d7a6a11c839552d46db49776b0c5605b286d8d1c4118c1e8ed02995b4e820535/biojava/biojava/issues/789 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d7a6a11c839552d46db49776b0c5605b286d8d1c4118c1e8ed02995b4e820535/biojava/biojava/issues/789 |
| og:image:alt | Calculating secondary structure of 4hhb 10000 times takes 589 seconds on my machine. If the following two lines are commented out, it takes 34 seconds: biojava/biojava-structure/src/main/java/org/b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | biocryst |
| hostname | github.com |
| expected-hostname | github.com |
| None | 25ef7e923c492d9047af899b2ba66bfcb0a78059369630f2ce2cf57826ed6a53 |
| turbo-cache-control | no-preview |
| go-import | github.com/biojava/biojava git https://github.com/biojava/biojava.git |
| octolytics-dimension-user_id | 237402 |
| octolytics-dimension-user_login | biojava |
| octolytics-dimension-repository_id | 9199359 |
| octolytics-dimension-repository_nwo | biojava/biojava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 9199359 |
| octolytics-dimension-repository_network_root_nwo | biojava/biojava |
| 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 | c0badd0db61d89a34653af2d762b2eb8c84f9d59 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width