jacksonsalopek / site

Personal website hosting blog, resume, and other content

Home Page:https://jacksonsalopek.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

activej-scala

GraalVM + Scala + ActiveJ + Twirl = <3

Setup

This project has an SDKMAN! configuration file in the root directory. If you have SDKMAN!, run:

sdk env install

The above command will install the necessary versions of Java and Scala.

Building

Ensure sbt is available on your machine. The following commands are available:

# Compiles the application
sbt compile

# Builds the native version of the application
sbt nativeImage

Running

To run the application, ensure port 8080 is available. Then, you can run any of the following:

# Run compiled native image
./target/native-image/activej-scala

# Run as native image
sbt nativeImageRun

# Run normally, attached to Java
sbt compile run

Performance

DISCLAIMER: my machine is most likely different from yours! Feel free to profile the project!

I've found the performance of this to be absolutely stellar on M1 Macbook Air, especially when running the compiled native image utilizing the MultiThreaded server example (src/main/scala/MultiThreaded.scala). According to my benchmarks, I've achieved an RPS of >170k with an average latency of 2ms. Very impressive for Java and Scala!

About

Personal website hosting blog, resume, and other content

https://jacksonsalopek.com


Languages

Language:TypeScript 24.5%Language:JavaScript 20.4%Language:Scala 19.9%Language:SCSS 16.1%Language:HTML 13.3%Language:CSS 3.1%Language:Dockerfile 2.5%Language:Shell 0.1%