René's URL Explorer Experiment


Title: perf: trim per-parse allocations that do no work by knutwannheden · Pull Request #2874 · JSQLParser/JSqlParser · GitHub

Open Graph Title: perf: trim per-parse allocations that do no work by knutwannheden · Pull Request #2874 · JSQLParser/JSqlParser

X Title: perf: trim per-parse allocations that do no work by knutwannheden · Pull Request #2874 · JSQLParser/JSqlParser

Description: Parsing performance.sql, the JMH benchmark's input, allocates 7.17 MB per parse on master, and about 1 MB of that (15%) does no work. The profile taken for #2870 found the sources: collections created on every call of a production but filled only on a rare path, a regex compiled for every LIKE, and function names joined into a string just to compare them. This PR is separate from #2870 so each PR's benchmark stays clean. Condition() created a deque for leading NOT and ! prefixes on every call, though few conditions are negated. An empty ArrayDeque allocates its 17-slot array up front. The deque is now created at the first NOT or !, as #2870 already does for the token deque beside it. PrimaryExpression() created two lists on every call, for chained signs such as - -1 and for JSON operators such as ->. Both are now created at their first element. LikeExpression.KeyWord.from called String.replaceAll("\\s+", "_"), which compiles the pattern on every call. The pattern is now a static constant. consumeXmlLeadingKeyword and FunctionArgumentList called Function.getName() for every function to check for XMLPARSE, XMLELEMENT or XMLFOREST, and getName() joins the name parts into a new string each time. Both now compare the single name part. Behaviour is unchanged, so there are no new tests. ExpressionPrecedenceTest pins stacked prefixes (not !1 = 1 deparses as NOT ! 1 = 1), DuckDBTest the chained signs, JsonExpressionRenderingTest the JSON operators, XmlForestTest the XML keywords and LikeExpressionTest the multi-word SIMILAR TO. ./gradlew jmh -PjmhProfiler=gc, alternating master (a075737) and this branch on the same machine. gc.alloc.rate.norm is bytes per parse: run master this branch 5.4 (master run / branch run) 1 time 39.07 ± 2.05 ms/op 38.19 ± 1.39 ms/op 49.52 / 48.21 ms/op 1 alloc 7,166,709 B/op 6,118,424 B/op (−14.6%) 7,767,862 / 7,751,289 2 time 39.56 ± 1.90 ms/op 38.55 ± 1.84 ms/op 48.71 / 49.66 ms/op 2 alloc 7,183,726 B/op 6,084,685 B/op (−15.3%) 7,784,537 / 7,767,974 The branch is 2.4% faster in both runs while the 5.4 control moves 2% either way, so the time difference is at the edge of what this benchmark resolves. The allocation difference is not in doubt. The Condition() change edits the same lines as #2870, so whichever merges second has a small conflict to resolve. Both deques can then be created together at the first NOT or !.

Open Graph Description: Parsing performance.sql, the JMH benchmark's input, allocates 7.17 MB per parse on master, and about 1 MB of that (15%) does no work. The profile taken for #2870 found the sources: collections ...

X Description: Parsing performance.sql, the JMH benchmark's input, allocates 7.17 MB per parse on master, and about 1 MB of that (15%) does no work. The profile taken for #2870 found the sources: collecti...

Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2874

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0ede5877-756c-3334-bc82-0e091c0e6109
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9828:3FCF3A:2F2B71:40ECC1:6B0498A9
html-safe-nonce6c60398da47a7b3f73e199b3da844ad143877ee0ca8e6f040ebd5db282696c2e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODI4OjNGQ0YzQToyRjJCNzE6NDBFQ0MxOjZCMDQ5OEE5IiwidmlzaXRvcl9pZCI6IjkyMTE3OTU4OTQ5MDE3MDg5NjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1cddf8d59eb0a40aae8e3e48cf8b43742fe7cb1e87fd69bb729e93c0fab2f55f
hovercard-subject-tagpull_request:5064051435
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/JSQLParser/JSqlParser/pull/2874/files
twitter:imagehttps://avatars.githubusercontent.com/u/408765?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/408765?s=400&v=4
og:image:altParsing performance.sql, the JMH benchmark's input, allocates 7.17 MB per parse on master, and about 1 MB of that (15%) does no work. The profile taken for #2870 found the sources: collections ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git
octolytics-dimension-user_id4643847
octolytics-dimension-user_loginJSQLParser
octolytics-dimension-repository_id1944709
octolytics-dimension-repository_nwoJSQLParser/JSqlParser
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1944709
octolytics-dimension-repository_network_root_nwoJSQLParser/JSqlParser
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3fd14143b75b2af7b76bbd23b069867d091adfcc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/JSQLParser/JSqlParser/pull/2874/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2874%2Ffiles
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%2FJSQLParser%2FJSqlParser%2Fpull%2F2874%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=JSQLParser%2FJSqlParser
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2874/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2874/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2874/files
JSQLParserhttps://github.com/JSQLParser
JSqlParserhttps://github.com/JSQLParser/JSqlParser
Codehttps://github.com/JSQLParser/JSqlParser
Issues2 (2)https://github.com/JSQLParser/JSqlParser/issues
Pull requests2 (2)https://github.com/JSQLParser/JSqlParser/pulls
Discussionshttps://github.com/JSQLParser/JSqlParser/discussions
Actionshttps://github.com/JSQLParser/JSqlParser/actions
Projectshttps://github.com/JSQLParser/JSqlParser/projects
Wikihttps://github.com/JSQLParser/JSqlParser/wiki
Security and qualityhttps://github.com/JSQLParser/JSqlParser/security
Insightshttps://github.com/JSQLParser/JSqlParser/insights
Sign up for GitHub https://github.com/signup?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose
manticore-projectshttps://github.com/manticore-projects
JSQLParser:masterhttps://github.com/JSQLParser/JSqlParser/tree/master
knutwannheden:jsqlparser-trim-two-per-parse-allocationshttps://github.com/knutwannheden/JSqlParser/tree/jsqlparser-trim-two-per-parse-allocations
Conversation 1 https://github.com/JSQLParser/JSqlParser/pull/2874
Commits 4 https://github.com/JSQLParser/JSqlParser/pull/2874/commits
Checks 10 https://github.com/JSQLParser/JSqlParser/pull/2874/checks
Files changed https://github.com/JSQLParser/JSqlParser/pull/2874/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2874/files
perf: trim per-parse allocations that do no work https://github.com/JSQLParser/JSqlParser/pull/2874/files#top
Show all changes 4 commits https://github.com/JSQLParser/JSqlParser/pull/2874/files
270d861 perf: create the deque of NOT prefixes only for a negated condition knutwannheden Oct 29, 2026 https://github.com/JSQLParser/JSqlParser/pull/2874/commits/270d861e8f3a5eddb73c0093f8ccdb5fdf836918
d192157 perf: precompile the whitespace pattern of LikeExpression.KeyWord.from knutwannheden Oct 29, 2026 https://github.com/JSQLParser/JSqlParser/pull/2874/commits/d1921570a187b1bc981ca74b4511b6f444e93dbd
a6624b7 perf: create PrimaryExpression's sign and JSON operator lists on firs… knutwannheden Oct 29, 2026 https://github.com/JSQLParser/JSqlParser/pull/2874/commits/a6624b7d3e255a98e2e2dd7f933fb964b87b2541
d896a6a perf: match XML function names without joining the name parts knutwannheden Oct 29, 2026 https://github.com/JSQLParser/JSqlParser/pull/2874/commits/d896a6af5f103cfbb5d16f9b8ef22870e5e538b5
Clear filters https://github.com/JSQLParser/JSqlParser/pull/2874/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2874/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2874/files
LikeExpression.java https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-7abe3db824aead6e24ed28068400ef028f705913db9b5d72e435502dbe855373
JSqlParserCC.jjt https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
src/main/java/net/sf/jsqlparser/expression/operators/relational/LikeExpression.javahttps://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-7abe3db824aead6e24ed28068400ef028f705913db9b5d72e435502dbe855373
View file https://github.com/knutwannheden/JSqlParser/blob/d896a6af5f103cfbb5d16f9b8ef22870e5e538b5/src/main/java/net/sf/jsqlparser/expression/operators/relational/LikeExpression.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2874/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-7abe3db824aead6e24ed28068400ef028f705913db9b5d72e435502dbe855373
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-7abe3db824aead6e24ed28068400ef028f705913db9b5d72e435502dbe855373
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-7abe3db824aead6e24ed28068400ef028f705913db9b5d72e435502dbe855373
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-7abe3db824aead6e24ed28068400ef028f705913db9b5d72e435502dbe855373
src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjthttps://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
View file https://github.com/knutwannheden/JSqlParser/blob/d896a6af5f103cfbb5d16f9b8ef22870e5e538b5/src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2874/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2874/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2874/files
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.