Files
kotlin-fork/js
Denis Zharkov 63c5d85cf4 Optimize memory footprint for generated protobuf code
The problem was that an overload of CodedOutputStream.newInstance
without size uses 4000 as a default value, thus allocating
a 4k-sized byte array.
At the same time the array remained effectively unused
in the most cases since it only used for storing data
for unknown fields.

Because such arrays are being created for each read of
protobuf message, during compilation of IntelliJ project
it was producing 25% of redundant memory traffic.

Of course these arrays were all in the young gen, but still
they have some effect on GC
2017-05-17 14:34:11 +03:00
..
2017-04-24 18:39:04 +03:00

JavaScript Translation

This module performs the translation of Kotlin source code to JavaScript.

There are various Kotlin APIs to JavaScript environments and libraries in the js.libraries project.

Compiling the Kotlin Standard Library for JavaScript

The Kotlin Standard Library for JS is built with gradle, see the corresponding module's ReadMe.

Reusing JVM based test cases in JavaScript

Any Kotlin test cases using the org.junit.Test annotation and the kotlin.test package, such as this test case are automatically converted to JavaScript using QUnit.

This allows the test cases to be run directly in a web page in any web browser.

Using the Kotlin Library in JavaScript

There is a simple sample which shows how to use the Kotlin Standard Library from inside JavaScript in a web page.

Contributing

We love contributions! The JavaScript translation could really use your help! If you fancy contributing: