# Kotlin 2.0.0 주요 변경사항

> Clean Markdown view of GeekNews topic #14958. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=14958](https://news.hada.io/topic?id=14958)
- GeekNews Markdown: [https://news.hada.io/topic/14958.md](https://news.hada.io/topic/14958.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2024-05-23T11:22:01+09:00
- Updated: 2024-05-23T11:22:01+09:00
- Original source: [kotlinlang.org](https://kotlinlang.org/docs/whatsnew20.html)
- Points: 7
- Comments: 1

## Topic Body

- Kotlin K2 컴파일러가 정식 버전이 됨. 기존 컴파일러 대비 성능 향상, 새로운 언어 기능 개발 속도 향상, 멀티플랫폼 프로젝트를 위한 구조 개선 등의 장점이 있음  
- 로컬 변수와 더 넓은 스코프, 논리 or 연산자를 이용한 타입 체크, inline 함수, 함수 타입 프로퍼티, 예외 처리, 증감 연산자 등에서 smart cast 개선됨  
- 멀티플랫폼 프로젝트에서 공통 및 플랫폼 소스 컴파일 시 엄격하게 분리됨. expect/actual 선언에서 가시성 레벨이 다를 수 있게 됨  
- Kotlin/Wasm은 Binaryen을 이용한 최적화 기본 지원, named export 지원, @JsExport 함수에서 unsigned primitive type 지원, JS exception catch 지원 등 개선됨  
- Kotlin/JS는 es2015 컴파일 타겟 추가, suspend 함수를 ES generator로 컴파일, main 함수에 인자 전달, 파일 단위 컴파일, 컬렉션 interop 개선, js-plain-objects 플러그인 등 개선됨  
- Kotlin Multiplatform은 Gradle DSL로 컴파일러 옵션 설정, Compose 컴파일러 플러그인 통합, Kotlin 데이터 폴더 변경, Kotlin/Native 컴파일러 필요할 때 다운로드 등 개선됨  
- 표준 라이브러리의 enum 클래스 values 제네릭 함수 대체, AutoCloseable 인터페이스, 공통 확장 함수 등이 stable로 변경됨

## Comments



### Comment 25497

- Author: ganadist
- Created: 2024-05-23T13:26:42+09:00
- Points: 2

간단한 (그리고 극단적인) 컴파일러 성능 벤치마크입니다.  
https://github.com/ganadist/kotlin_build_performance  
  
* 각 프로젝트에 class 200개, 각 class에는 2000개 필드 포함  
  
* java : 2초  
* kotlin 1.9.24 : 1분 20초  
* kotlin 2.0.0 : 1분 1초  
  
Macbook Pro M1 Max 에서 확인했습니다.  
  
위 프로젝트는 좀 극단적인 경우이고, 일반적으로는 kotlin 1.9 대비 2.0의 컴파일 속도가 2배가량 나오는 것 같습니다.
