scala-offheap-macros


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

sh.den
ArtifactId

ArtifactId

scala-offheap-macros_2.11
Last Version

Last Version

0.1
Release Date

Release Date

Type

Type

jar
Description

Description

scala-offheap-macros
scala-offheap-macros
Project URL

Project URL

https://github.com/densh/scala-offheap
Project Organization

Project Organization

sh.den

Download scala-offheap-macros_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/sh.den/scala-offheap-macros_2.11/ -->
<dependency>
    <groupId>sh.den</groupId>
    <artifactId>scala-offheap-macros_2.11</artifactId>
    <version>0.1</version>
</dependency>
// https://jarcasting.com/artifacts/sh.den/scala-offheap-macros_2.11/
implementation 'sh.den:scala-offheap-macros_2.11:0.1'
// https://jarcasting.com/artifacts/sh.den/scala-offheap-macros_2.11/
implementation ("sh.den:scala-offheap-macros_2.11:0.1")
'sh.den:scala-offheap-macros_2.11:jar:0.1'
<dependency org="sh.den" name="scala-offheap-macros_2.11" rev="0.1">
  <artifact name="scala-offheap-macros_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='sh.den', module='scala-offheap-macros_2.11', version='0.1')
)
libraryDependencies += "sh.den" % "scala-offheap-macros_2.11" % "0.1"
[sh.den/scala-offheap-macros_2.11 "0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.6
org.scala-lang : scala-reflect jar 2.11.6

Project Modules

There are no modules declared in this project.

Type-safe off-heap memory for Scala

Build Status Join the chat at https://gitter.im/densh/scala-offheap

Garbage collection is the standard memory management paradigm on the JVM. In theory, it lets one completely forget about the hurdles of memory management and delegate all of it to the underlying runtime. In practice, GC often leads to scalability issues on large heaps and latency-sensitive workloads.

The goal of this project is to expose a completely different memory management paradigm to the developers: explicitly annotated region-based memory. This paradigm gives more control over memory management without the need to micro-manage allocations.

@data class Dummy(id: Int) {
  def hello: Unit = println(s"Hello, i'm $id")
}

Region { implicit r =>
  for (i <- 1 to 100)
     Dummy(i).hello
}

For example the snippet above allocates 100 objects in a memory region. As long as the region is open, objects are retained in memory and available for access. Once it ends, all of them are efficiently deallocated at once.

Features

  • Efficient scoped region-based memory allocator
  • Optional low-overhead memory sanitizer for debugging and development
  • Offheap classes as a nice typed API for custom data layout
  • Offheap arrays with direct sequential layout in memory
  • Extensibility to accomodate custom memory allocators

Documentation

Documentation is available in docs subfolder.

How to contribute

  1. Check the list of open issues and see if you are interested in fixing any of them. If you have encountered a problem or have a feature suggestion feel free to open a new issue.
  2. Fork the main repo and start hacking up the fix. If you have problems with getting started, contact @densh to help you out.
  3. Whenever you fix an issue, add a test that shows that it was indeed fixed. If you introduce a new feature, add a new test suite with a bunch of tests that cover common use cases. If you propose a performance enhancement, include before & after results of a corresponding jmh performance benchmark run in the commit message.
  4. Fire up a pull request. Don't forget to sign the Scala CLA.

Versions

Version
0.1