# Faster compilation when having many programs

**URL:** <https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129>\
**Category:** Tutorials\
**Created:** [July 4, 2020, 1:26pm UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129 "2020-07-04T13:26:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [July 4, 2020, 1:26pm UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/1 "2020-07-04T13:26:39Z")

</div>

At some point, if you keep adding programs to the same `openrndr-template` things will start to get slow in IntelliJ Idea. I have now 84 programs and 114 kotlin files and it’s quite noticeable.

I figured out a solution.

I was throwing all my programs into a package called `apps`. What I did:

- Add a second package where to store active programs. You could call the old package `archived` and the new one `current`.
- Go to `File > Project Structure > Modules > main > Sources`.
- Right click on the package to deactivate (`archived` or `apps` in my case).
- Flag it as `Excluded`.

That’s it. Idea will no longer look into this folder, making everything fast again. In my case it compiles faster and autocomplete is much faster too.

 ![2020-07-04-151843_895x598_scrot](https://global.discourse-cdn.com/free1/uploads/openrndr/original/1X/0f83b76c324fa84224fb9eea351f9300d87d588f.png)

Note: you can move programs back and forth between both folders. Move a program into `current` to work on it again, throw it into `archive` if you’re done for now.

What do you think about this approach? Do you know better ways to improve performance on growing collections of programs? I could clone the `openrndr-template` template again and start from scratch, but I want to have access to all the helpers and classes I’ve built so far (my packages called `math`, `geometry`, `random`, etc).

---

<div class="post-metadata">

**Author:** ![Yann](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Yann](https://openrndr.discourse.group/u/Yann)\
**Post date:** [July 4, 2020, 5:10pm UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/2 "2020-07-04T17:10:13Z")

</div>

thank you! I was noticing this too

---

<div class="post-metadata">

**Author:** ![dector](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/dector/32/36_2.png) [@dector](https://openrndr.discourse.group/u/dector)\
**Post date:** [July 4, 2020, 9:03pm UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/3 "2020-07-04T21:03:51Z")

</div>

@abe Which Kotlin and Gradle versions are you using?

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [July 5, 2020, 8:17am UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/4 "2020-07-05T08:17:40Z")

</div>

In my system I have this:

```auto
------------------------------------------------------------
Gradle 6.5
------------------------------------------------------------

Build time: 2020-06-13 14:39:45 UTC
Revision: <unknown>

Kotlin: 1.3.72
Groovy: 2.5.11
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 1.8.0_252 (Oracle Corporation 25.252-b09)
OS: Linux 5.7.6-arch1-1 amd64

```

But here

> <https://github.com/openrndr/openrndr-template/blob/master/gradle/wrapper/gradle-wrapper.properties>

  
I see gradle 6.4

What’s the right way to check those values @dector ? And what impact does it have?

---

<div class="post-metadata">

**Author:** ![dector](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/dector/32/36_2.png) [@dector](https://openrndr.discourse.group/u/dector)\
**Post date:** [July 5, 2020, 12:22pm UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/5 "2020-07-05T12:22:04Z")

</div>

```auto
cd /path/to/your/projects
./gradlew --version

```

will should you values for the project.

I’m also using `archive` + `libs` + `workbook` strategy for genart project (mostly because I was compiling with K/JS and output js file was growing too fast, compiling/loading too slow).

However, on other projects (Gradle 6.5 + Kotlin 1.3.72) I’ve notices huge improvement in incremental compilation speed. I guess its because of the latest improvements in Gradle (e.g. see comparison between [Gradle and Bazel](https://blog.gradle.org/gradle-vs-bazel-jvm)).

Also there are few new options to speed-up build ([Configuration cache](https://docs.gradle.org/nightly/userguide/configuration_cache.html) and [File System watching](https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:daemon_watch_fs)).

Also JB focusing on improving compiler speed in 1.4 release. We’ll see. But preliminary numbers seems very nice. 😃

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [August 14, 2020, 9:27am UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/6 "2020-08-14T09:27:34Z")

</div>

With K/JS do you mean javascript? with openrndr?

---

<div class="post-metadata">

**Author:** ![dector](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/dector/32/36_2.png) [@dector](https://openrndr.discourse.group/u/dector)\
**Post date:** [August 14, 2020, 9:14pm UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/7 "2020-08-14T21:14:51Z")

</div>

Yup, Kotlin/JavaScript. But I was using my own tool, not OpenRNDR.

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [August 15, 2020, 7:13am UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/8 "2020-08-15T07:13:44Z")

</div>

Ah cool. Can you share anything about your tool? What can you do with it? Does it use WebGL?

---

<div class="post-metadata">

**Author:** ![dector](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/dector/32/36_2.png) [@dector](https://openrndr.discourse.group/u/dector)\
**Post date:** [January 8, 2021, 12:37pm UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/9 "2021-01-08T12:37:43Z")

</div>

@abe Sorry, missed notification about your message. I was using old Kotlin JS compiler with output to Canvas previously but now re-implementing it to use Skia instead.

Focused mostly on static images and data-driven result.

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [January 8, 2021, 5:03pm UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/10 "2021-01-08T17:03:52Z")

</div>

Oh nice, how’s your experience with Skia? What language / framework are you using with it? I see Skia is written with C++17…

---

<div class="post-metadata">

**Author:** ![dector](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/dector/32/36_2.png) [@dector](https://openrndr.discourse.group/u/dector)\
**Post date:** [January 9, 2021, 10:04am UTC](https://openrndr.discourse.group/t/faster-compilation-when-having-many-programs/129/11 "2021-01-09T10:04:29Z")

</div>

Yes, Skia itself is built in C++ but has bindings to many languages. Just recently JetBrains released quite good Java binding for it ([GitHub - JetBrains/skija: Skia bindings for Java](https://github.com/JetBrains/skija)) and Kotlin MP bindings ([GitHub - JetBrains/skiko: Kotlin MPP bindings to Skia](https://github.com/JetBrains/skiko/)). I’m using Kotlin with skiko (it has built-in window management toolking).

Skia is widely used these days by different vendors and seems like proper drawing 2D library for JVM (finally 🙂 ).
