René's URL Explorer Experiment


Title: [이호석] CH02 자바 컴파일 과정에 대한 간단한 이해 + 주석은 성능에 영향을 끼치지 않는다 · Issue #6 · Invincible-Backend-Study/java-basic · GitHub

Open Graph Title: [이호석] CH02 자바 컴파일 과정에 대한 간단한 이해 + 주석은 성능에 영향을 끼치지 않는다 · Issue #6 · Invincible-Backend-Study/java-basic

X Title: [이호석] CH02 자바 컴파일 과정에 대한 간단한 이해 + 주석은 성능에 영향을 끼치지 않는다 · Issue #6 · Invincible-Backend-Study/java-basic

Description: 🤔 왜 이슈를 생성했나요? 현식님의 #1 이슈에서 현식님과 재홍님은 실습을 통해 증명해주셨습니다. 저는 여기에 이론을 곁들이면 더 좋을것 같아 코멘트를 작성하게 됐습니다. 생각보다 글이 길어져서 별도의 이슈로 분리하게 됐습니다! ㅎㅎ 😁 공유하고 싶은 내용 자바 파일에 대한 이해 우리가 작성한 .java 파일은 모두 텍스트 파일입니다. 따라서 일반 텍스트 편집기에서 읽을 수 있습니다. 일반 텍스트 파일과의 차이점으로는 J...

Open Graph Description: 🤔 왜 이슈를 생성했나요? 현식님의 #1 이슈에서 현식님과 재홍님은 실습을 통해 증명해주셨습니다. 저는 여기에 이론을 곁들이면 더 좋을것 같아 코멘트를 작성하게 됐습니다. 생각보다 글이 길어져서 별도의 이슈로 분리하게 됐습니다! ㅎㅎ 😁 공유하고 싶은 내용 자바 파일에 대한 이해 우리가 작성한 .java 파일은 모두 텍스트 파일입니다. 따라서 일반 텍...

X Description: 🤔 왜 이슈를 생성했나요? 현식님의 #1 이슈에서 현식님과 재홍님은 실습을 통해 증명해주셨습니다. 저는 여기에 이론을 곁들이면 더 좋을것 같아 코멘트를 작성하게 됐습니다. 생각보다 글이 길어져서 별도의 이슈로 분리하게 됐습니다! ㅎㅎ 😁 공유하고 싶은 내용 자바 파일에 대한 이해 우리가 작성한 .java 파일은 모두 텍스트 파일입니다. 따라서 일반 텍...

Opengraph URL: https://github.com/Invincible-Backend-Study/java-basic/issues/6

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[이호석] CH02 자바 컴파일 과정에 대한 간단한 이해 + 주석은 성능에 영향을 끼치지 않는다 ","articleBody":"## 🤔 왜 이슈를 생성했나요?\r\n현식님의 https://github.com/Invincible-Backend-Study/java-basic/issues/1 이슈에서 현식님과 재홍님은 실습을 통해 증명해주셨습니다. 저는 여기에 이론을 곁들이면 더 좋을것 같아 코멘트를 작성하게 됐습니다.\r\n\r\n\u003e 생각보다 글이 길어져서 별도의 이슈로 분리하게 됐습니다! ㅎㅎ\r\n\r\n\u003cbr\u003e\r\n\r\n## 😁 공유하고 싶은 내용\r\n### 자바 파일에 대한 이해\r\n\u003cimg src=\"https://user-images.githubusercontent.com/66772624/229870697-4bdb5d78-4404-45ad-a842-20f1acfb4c64.png\" width=\"500\" height=\"\"\u003e\r\n\r\n우리가 작성한 `.java` 파일은 모두 텍스트 파일입니다. 따라서 일반 텍스트 편집기에서 읽을 수 있습니다. \r\n\r\n일반 텍스트 파일과의 차이점으로는 Java 코드로 이루어져 있고, Java 컴파일러가 읽을 수 있는 확장자라는 부분에서 차이점 있습니다.\r\n\r\n\u003cbr\u003e\r\n\r\n### 자바 컴파일 과정에 대한 이해\r\n그렇다면 일반 텍스트 파일인 `.java`파일을 어떻게 컴파일 할까요?\r\n자바는 소스 코드 컴파일 과정이 스펙에 명시되어 있지 않지만, C언어의 컴파일 과정을 예시로 보면 다음과 같습니다.\r\n`전처리 -\u003e 컴파일 -\u003e 어셈블리 -\u003e 링킹`\r\n이때 전처리 과정에서 주석제거, 매크로 인라인화, include(import) 파일 인라인화가 이루어집니다.\r\n\r\n자바에서는 다음과 같이 컴파일 과정을 명시합니다.\r\n- `자바 소스 코드 파일(.java) -\u003e javac 컴파일러 -\u003e JVM 바이트코드(.class)`\r\nJava는 컴파일 + 어셈블리 과정을 하나로 뭉쳐서 컴파일이라고 말하기도 합니다.\r\n\r\n여기서 컴파일러에서 진행되는 세부 단계를 살펴보면 다음과 같습니다.\r\n\r\n1. `Lexical Analysis(어휘 분석)`\r\n소스 코드에서 문자 단위로 읽어 어휘소를 식별 하고 토큰 스트림을 생성합니다.\r\npublic, class, main, for과 같은 `키워드` 분석, 1L, 2.3f같은 `리터럴` 분석, 식별자, 연산자, 구분 문자 등을 분석하여 토큰 스트림을 생성합니다.\r\n\r\n2. `Syntax Analysis(구문 분석)`\r\n어휘 분석 결과로 생성한 토큰 스트림을 이용해 자바 언어의 스펙 형식에 맞는지 문법을 검사합니다. 문법이 틀리다면 컴파일 에러가 발생하고 맞다면 Parse Tree를 생성합니다. (트리 자료구조)\r\n\r\n3. `Symantic Analysis(의미 분석)`\r\n이곳에서는 타입 검사, 자동 타입 변환 등이 수행됩니다. (int a = \"a\" -\u003e 컴파일 오류 발생) 이후 파스 트리에 정보들이 추가 됩니다.\r\n\r\n4. `Intermediate Code Generation(중간 코드 생성)`\r\n윗 단계를 통과하면 파스 트리를 바탕으로 기게어로 변환하기 좋은 형태인 중간 언어로된 중간 코드를 생성합니다.\r\n자바의 `바이트 코드`가 중간 코드에 해당됩니다. \r\n자바, 클로저, 스칼라, 코틀린과 같은 언어와 같이 JVM에서 실행되는 언어들은 모두 이 바이트 코드(중간 코드)를 생성합니다.\r\n\r\n4. `Code Optimization(중간 코드 최적화)`\r\n중간 코드가 더 효율적인 기계어로 변환되도록 최적화 하는 과정이 수행됩니다.\r\n\r\n\u003cbr\u003e\r\n\r\n이렇게 컴파일이 완료되면 .class 라는 바이트 코드가 생성됩니다.\r\n따라서 컴파일 과정에서 주석이 굉장히 많아질 경우 위의 분석 단계에서 많은 시간을 소요하게 됩니다.\r\n\r\n또한 결과물인 바이트 코드에서는 개발자가 작성한 주석이 남아있지 않지만, 그 흔적을 찾아볼 수 있습니다!\r\n\r\n자바는 전처리 과정에서 주석이 있던 행 자체가 제거되지 않습니다. 따라서 바이트 코드 내용중에서 자바 소스 코드의 행 번호와 바이트코드 명령어의 위치를 매핑하는 부분에서 주석이 있던 행이 제거되지 않은 상태의 행 번호가 표시됩니다.\r\n\r\nMain 클래스가 존재할때 빌드를 하게 되면\r\n![image](https://user-images.githubusercontent.com/66772624/229895187-08b1e2fe-023b-4de3-860a-e12ca5add538.png)\r\n\r\n다음과 같은 바이트코드를 살펴볼 수 있습니다. (IntelliJ)\r\n![image](https://user-images.githubusercontent.com/66772624/229881086-1326074d-7077-423a-9cf9-e3fb84397d6b.png)\r\n\r\n위 바이트 코드에 하이라이팅 된 부분을 보면 Line 8에 \"Hello World!\"를 출력한다는 정보를 살펴볼 수 있습니다.\r\n이는 주석이 제거되지 않은 상태의 행 번호와 일치합니다.\r\n\r\n이를 통해 자바 컴파일 과정에서 주석의 양이 굉장히 많아질 경우 컴파일 성능에 차이가 있음을 유추할 수 있습니다.\r\n\r\n\r\n\u003cbr\u003e\r\n\r\n### 빌드와 컴파일\r\n\r\n개인적으로 자료를 찾아보면서 두 용어에 대한 혼동이 있었습니다.\r\n\r\n- 빌드:  소프트웨어의 결과물을 만드는데 필요한 모든 단계를 포괄하는 프로세스 이며 소스 파일을 컴퓨터에서 실행할 수 있는 독립적인 형태로 변환하는 과정 및 결과를 말합니다. 자바에서는 다음과 같이 빌드하게 됩니다.\r\n  - 코드 작성\r\n  - 코드 컴파일\r\n  - 테스트 코드 컴파일\r\n  - 테스트 실행(단위, 통합 테스트 등)\r\n  - 패키징(jar, war 등)\r\n  - 상태 검사 실행\r\n  - 보고서 생성\r\n\r\n위 과정을 살펴봤을때 컴파일 과정은 빌드의 부분집합으로 포함됨을 알 수 있습니다.\r\n\r\n따라서 주석이 많아지면 컴파일시 속도가 느려진다 -\u003e OK\r\n혹은 주석이 많아지면 빌드 속도가 느려진다 -\u003e OK\r\n모두 맞는 말이라고 생각합니다!\r\n\r\n\u003cbr\u003e\r\n\r\n## 📌 참고자료\r\n[What is .java file?](https://www.lifewire.com/what-is-a-java-file-2622759)\r\n[Building vs. Compiling (Java) - stackoverflow](https://stackoverflow.com/questions/2650168/building-vs-compiling-java)\r\n[Back to the Essence - Java 컴파일에서 실행까지 - (1) - HomoEfficio](https://homoefficio.github.io/2019/01/31/Back-to-the-Essence-Java-%EC%BB%B4%ED%8C%8C%EC%9D%BC%EC%97%90%EC%84%9C-%EC%8B%A4%ED%96%89%EA%B9%8C%EC%A7%80-1/)","author":{"url":"https://github.com/HiiWee","@type":"Person","name":"HiiWee"},"datePublished":"2023-04-04T18:27:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/6/java-basic/issues/6"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3053d130-7178-d150-292b-cbdaefd0670d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA132:3910C8:1904FB0:23BDD03:6978E4FE
html-safe-noncecf784250ffafcf58c7ccd912298b3724b191d888b56d113f98b9f21bf8729de4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTMyOjM5MTBDODoxOTA0RkIwOjIzQkREMDM6Njk3OEU0RkUiLCJ2aXNpdG9yX2lkIjoiNzI5ODE0MDI3Mzc0MzgxNTkzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca018d9743186ed88cd71b40d00f3532673adc2396caf33c263077fb97912e021
hovercard-subject-tagissue:1654364697
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/Invincible-Backend-Study/java-basic/6/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d3c50ba7d94686194957bc7320eb8fcde8f1a9f7d45e33947edf4496b967b802/Invincible-Backend-Study/java-basic/issues/6
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d3c50ba7d94686194957bc7320eb8fcde8f1a9f7d45e33947edf4496b967b802/Invincible-Backend-Study/java-basic/issues/6
og:image:alt🤔 왜 이슈를 생성했나요? 현식님의 #1 이슈에서 현식님과 재홍님은 실습을 통해 증명해주셨습니다. 저는 여기에 이론을 곁들이면 더 좋을것 같아 코멘트를 작성하게 됐습니다. 생각보다 글이 길어져서 별도의 이슈로 분리하게 됐습니다! ㅎㅎ 😁 공유하고 싶은 내용 자바 파일에 대한 이해 우리가 작성한 .java 파일은 모두 텍스트 파일입니다. 따라서 일반 텍...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameHiiWee
hostnamegithub.com
expected-hostnamegithub.com
None8a71ca1f7ab5436216e1df86f398ef7a51ed3152c90e3f7332fc70cf97fcb9d6
turbo-cache-controlno-preview
go-importgithub.com/Invincible-Backend-Study/java-basic git https://github.com/Invincible-Backend-Study/java-basic.git
octolytics-dimension-user_id122281532
octolytics-dimension-user_loginInvincible-Backend-Study
octolytics-dimension-repository_id619187462
octolytics-dimension-repository_nwoInvincible-Backend-Study/java-basic
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id619187462
octolytics-dimension-repository_network_root_nwoInvincible-Backend-Study/java-basic
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
release024f9f4ca72571329d73933440b8ceb5414e77a5
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/issues/6#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FInvincible-Backend-Study%2Fjava-basic%2Fissues%2F6
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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FInvincible-Backend-Study%2Fjava-basic%2Fissues%2F6
Sign up https://patch-diff.githubusercontent.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=Invincible-Backend-Study%2Fjava-basic
Reloadhttps://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/issues/6
Reloadhttps://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/issues/6
Reloadhttps://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/issues/6
Invincible-Backend-Study https://patch-diff.githubusercontent.com/Invincible-Backend-Study
java-basichttps://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FInvincible-Backend-Study%2Fjava-basic
Fork 5 https://patch-diff.githubusercontent.com/login?return_to=%2FInvincible-Backend-Study%2Fjava-basic
Star 0 https://patch-diff.githubusercontent.com/login?return_to=%2FInvincible-Backend-Study%2Fjava-basic
Code https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic
Issues 4 https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/issues
Pull requests 2 https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/pulls
Actions https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/actions
Projects 0 https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/projects
Security 0 https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/security
Insights https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/pulse
Code https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic
Issues https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/issues
Pull requests https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/pulls
Actions https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/actions
Projects https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/projects
Security https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/security
Insights https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Invincible-Backend-Study/java-basic/issues/6
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Invincible-Backend-Study/java-basic/issues/6
[이호석] CH02 자바 컴파일 과정에 대한 간단한 이해 + 주석은 성능에 영향을 끼치지 않는다 https://patch-diff.githubusercontent.com/Invincible-Backend-Study/java-basic/issues/6#top
https://patch-diff.githubusercontent.com/HiiWee
공유https://github.com/Invincible-Backend-Study/java-basic/issues?q=state%3Aopen%20label%3A%22%EA%B3%B5%EC%9C%A0%22
https://github.com/HiiWee
https://github.com/HiiWee
HiiWeehttps://github.com/HiiWee
on Apr 4, 2023https://github.com/Invincible-Backend-Study/java-basic/issues/6#issue-1654364697
#1https://github.com/Invincible-Backend-Study/java-basic/issues/1
https://user-images.githubusercontent.com/66772624/229870697-4bdb5d78-4404-45ad-a842-20f1acfb4c64.png
https://user-images.githubusercontent.com/66772624/229895187-08b1e2fe-023b-4de3-860a-e12ca5add538.png
https://user-images.githubusercontent.com/66772624/229881086-1326074d-7077-423a-9cf9-e3fb84397d6b.png
What is .java file?https://www.lifewire.com/what-is-a-java-file-2622759
Building vs. Compiling (Java) - stackoverflowhttps://stackoverflow.com/questions/2650168/building-vs-compiling-java
Back to the Essence - Java 컴파일에서 실행까지 - (1) - HomoEfficiohttps://homoefficio.github.io/2019/01/31/Back-to-the-Essence-Java-%EC%BB%B4%ED%8C%8C%EC%9D%BC%EC%97%90%EC%84%9C-%EC%8B%A4%ED%96%89%EA%B9%8C%EC%A7%80-1/
HiiWeehttps://patch-diff.githubusercontent.com/HiiWee
공유https://github.com/Invincible-Backend-Study/java-basic/issues?q=state%3Aopen%20label%3A%22%EA%B3%B5%EC%9C%A0%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.