René's URL Explorer Experiment


Title: Concerns regarding the way jsoniter is implemented for high performance parsing · Issue #342 · json-iterator/java · GitHub

Open Graph Title: Concerns regarding the way jsoniter is implemented for high performance parsing · Issue #342 · json-iterator/java

X Title: Concerns regarding the way jsoniter is implemented for high performance parsing · Issue #342 · json-iterator/java

Description: So my pom.xml has following dependencies: com.jsoniter jsoniter 0.9.23 org.javassist javassist

Open Graph Description: So my pom.xml has following dependencies: com.jsoniter jsoniter 0.9.23 org.javassist<...

X Description: So my pom.xml has following dependencies: <dependency> <groupId>com.jsoniter</groupId> <artifactId>jsoniter</artifactId> <version>0.9.23</version> </dep...

Opengraph URL: https://github.com/json-iterator/java/issues/342

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Concerns regarding the way jsoniter is implemented for high performance parsing","articleBody":"So my pom.xml has following dependencies:\r\n```\r\n\u003cdependency\u003e\r\n    \u003cgroupId\u003ecom.jsoniter\u003c/groupId\u003e\r\n    \u003cartifactId\u003ejsoniter\u003c/artifactId\u003e\r\n    \u003cversion\u003e0.9.23\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n\r\n\u003cdependency\u003e\r\n    \u003cgroupId\u003eorg.javassist\u003c/groupId\u003e\r\n    \u003cartifactId\u003ejavassist\u003c/artifactId\u003e\r\n    \u003cversion\u003e3.29.2-GA\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\nFollowing is a class I wrote to do a simple test with _**javaassist**_ enabled\r\n\r\n```\r\npublic class Json {\r\n    public static void main(String[] args) {\r\n\r\n\r\n        System.out.println(JsoniterSpi.getDefaultConfig().decodingMode()); // REFLECTION_MODE\r\n        System.out.println(JsoniterSpi.getDefaultConfig().encodingMode()); // REFLECTION_MODE\r\n\r\n        JsonIterator.setMode(DecodingMode.DYNAMIC_MODE_AND_MATCH_FIELD_WITH_HASH);\r\n        JsonStream.setMode(EncodingMode.DYNAMIC_MODE);\r\n\r\n        String json = \"{\\\"id\\\":1,\\\"name\\\":{\\\"firstName\\\":\\\"Joe\\\",\\\"surname\\\":\\\"Blogg\\\"}}\";\r\n\r\n        Student student = JsonIterator.deserialize(json, Student.class); // decoding to Student.class\r\n\r\n        Any any = JsonIterator.deserialize(json); // decoding to any\r\n\r\n        System.out.println(student);\r\n        System.out.println(any);\r\n    }\r\n\r\n    @ToString\r\n    public static class Name {\r\n        private String firstName;\r\n        public String surname;\r\n    }\r\n\r\n    @ToString\r\n    public static class Student {\r\n        public int id;\r\n        public Name name;\r\n    }\r\n}\r\n```\r\n\r\nI got the following answer:\r\n```\r\nREFLECTION_MODE\r\nREFLECTION_MODE\r\nJson.Student(id=1, name=Json.Name(firstName=null, surname=Blogg))\r\n{\"id\":1,\"name\":{\"firstName\":\"Joe\",\"surname\":\"Blogg\"}}\r\n```\r\n\r\nMy key takeaways:\r\n\r\n1. By default REFLECTION_MODE is used\r\n2. When javaassist is added, I have to enable flags to open java modules. For example, `--add-opens java.base/java.lang=ALL-UNNAMED`\r\n3. The attributes of a class should be public if we serialize/deserialize using javaassist \r\n\r\n**Question 1:**\r\nI need to verify above points and whether or not I understand them correctly. I need the absolute fastest possible encoding/decoding speeds. _Is the way I utilized above libraries correct?_\r\n\r\n**Question 2:**\r\nSuppose I just want to use simple lazy parsing with Any like this: `Any any = JsonIterator.deserialize(json);`, _does javaassist still make a difference in speed here?_ Provided I do not map to any of my clsses. Just keep deserializing to Any object and use it like a Hashmap. In simple terms I only want to use **Any** and **Iterator** APIs. _Do I still need javaassist to get the performance boost?_\r\n\r\nSources:\r\n1. https://www.sitepoint.com/php-style-json-parsing-in-java-with-jsoniter/\r\n2. https://www.baeldung.com/java-jsoniter","author":{"url":"https://github.com/ahrooran-r","@type":"Person","name":"ahrooran-r"},"datePublished":"2023-04-07T18:55:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/342/java/issues/342"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e05357ac-fa38-d74b-0032-c0a6d9a5a276
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB5F4:2B46F2:3D7313:55D308:696A4F3A
html-safe-nonce87a92c8f5f89d66429f09eaaf0ca1750f7e4fadd7b5bead22df9f48c3199226b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUY0OjJCNDZGMjozRDczMTM6NTVEMzA4OjY5NkE0RjNBIiwidmlzaXRvcl9pZCI6IjExMzY0ODIxOTI2MzI0NjcyNTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7dd8e771a426ee11e48ff64c28be3d19439316e367209bd7adb104f260322d35
hovercard-subject-tagissue:1659094931
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/json-iterator/java/342/issue_layout
twitter:imagehttps://opengraph.githubassets.com/52aa4a0e01d3aad9e7e08e117345cbdd2eb8325eef8d3202af7ce139c90b29a9/json-iterator/java/issues/342
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/52aa4a0e01d3aad9e7e08e117345cbdd2eb8325eef8d3202af7ce139c90b29a9/json-iterator/java/issues/342
og:image:altSo my pom.xml has following dependencies: com.jsoniter jsoniter 0.9.23 org.javassist<...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameahrooran-r
hostnamegithub.com
expected-hostnamegithub.com
None3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef
turbo-cache-controlno-preview
go-importgithub.com/json-iterator/java git https://github.com/json-iterator/java.git
octolytics-dimension-user_id24260074
octolytics-dimension-user_loginjson-iterator
octolytics-dimension-repository_id75621695
octolytics-dimension-repository_nwojson-iterator/java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id75621695
octolytics-dimension-repository_network_root_nwojson-iterator/java
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
release63c426b30d262aba269ef14c40e3c817b384cd61
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/json-iterator/java/issues/342#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjson-iterator%2Fjava%2Fissues%2F342
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjson-iterator%2Fjava%2Fissues%2F342
Sign up https://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=json-iterator%2Fjava
Reloadhttps://github.com/json-iterator/java/issues/342
Reloadhttps://github.com/json-iterator/java/issues/342
Reloadhttps://github.com/json-iterator/java/issues/342
json-iterator https://github.com/json-iterator
javahttps://github.com/json-iterator/java
Notifications https://github.com/login?return_to=%2Fjson-iterator%2Fjava
Fork 530 https://github.com/login?return_to=%2Fjson-iterator%2Fjava
Star 1.6k https://github.com/login?return_to=%2Fjson-iterator%2Fjava
Code https://github.com/json-iterator/java
Issues 85 https://github.com/json-iterator/java/issues
Pull requests 29 https://github.com/json-iterator/java/pulls
Actions https://github.com/json-iterator/java/actions
Projects 0 https://github.com/json-iterator/java/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/json-iterator/java/security
Please reload this pagehttps://github.com/json-iterator/java/issues/342
Insights https://github.com/json-iterator/java/pulse
Code https://github.com/json-iterator/java
Issues https://github.com/json-iterator/java/issues
Pull requests https://github.com/json-iterator/java/pulls
Actions https://github.com/json-iterator/java/actions
Projects https://github.com/json-iterator/java/projects
Security https://github.com/json-iterator/java/security
Insights https://github.com/json-iterator/java/pulse
New issuehttps://github.com/login?return_to=https://github.com/json-iterator/java/issues/342
New issuehttps://github.com/login?return_to=https://github.com/json-iterator/java/issues/342
Concerns regarding the way jsoniter is implemented for high performance parsinghttps://github.com/json-iterator/java/issues/342#top
https://github.com/ahrooran-r
https://github.com/ahrooran-r
ahrooran-rhttps://github.com/ahrooran-r
on Apr 7, 2023https://github.com/json-iterator/java/issues/342#issue-1659094931
https://www.sitepoint.com/php-style-json-parsing-in-java-with-jsoniter/https://www.sitepoint.com/php-style-json-parsing-in-java-with-jsoniter/
https://www.baeldung.com/java-jsoniterhttps://www.baeldung.com/java-jsoniter
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.