Skip to content

Instantly share code, notes, and snippets.

@the-frey
Last active December 2, 2019 16:43
Show Gist options
  • Save the-frey/c3de1144873d15af6128ed2bd54a4582 to your computer and use it in GitHub Desktop.
Save the-frey/c3de1144873d15af6128ed2bd54a4582 to your computer and use it in GitHub Desktop.

Re-Clojure Conf

Growing Mobile Apps with ClojureScript and React Native - Dan Neal

  • Use Expo for React Native
  • Shadow-cljs
    • npm libs are easier to use
    • simple config
    • e.g. for externs {:infer-externs :auto}
  • Use tachyons for design
  • Chrome profiler
  • Example app with tools
  • Crucial point: app doesn't target desktop, only devices
  • REPL most useful for debugging errors on node rather than as RDD workflow

Living in a Box. Life in Containers with the JVM - Matthew Gilliard

  • Things that affect startup time matter more in a containerized environment. You should try and move startup activities to build time:
    • Loading Java classes in memory
      • Class Data Sharing (core Java - distributed w/JDK)
      • Application Class Data Sharing (your app)
    • AOT Compilation with Graal
      • use native-image that comes with Graal
      • fast startup, but:
        • worse peak performance
        • potentially worse GC
    • Efficient images
      • small size
        • use an Alpine Linux base image
        • openjdk11:alpine
      • use layers to your advantage
        • copy on write means identical layers are shared
        • so can you, e.g. put dependencies into a layer?
          • a useful tool on github: orb/lein-metajar
          • this means you can create a layer from the dep jars
    • Respect the environment
      • JVM self-tunes (ergonomics) based on
        • available RAM
          • depending on memory, it selects
            • heap space
            • compiler/GC cache sizes
            • which GC to use
        • available CPUs
          • selects:
            • GC/compiler threadpool sizes
            • Runtime::getAvailableCPUs
      • JVM now respects container resource limits in 10, and > Java 8 u212
      • Fun fact, there are 666 JVM args
      • -XX:+PrintFlagsFinal on yr java cmd followed by | grep ergonomic will show you how many JVM flags are set by ergonomics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment