Skip to content

activeviam/par-student-panama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vector API powered by Panama Project

Project architecture

This project distinguishes between two types of vectors:

  • On heap vectors represented by all classes implementing the abstract class AArrayVector
  • Off heap vectors represented by all classes implementing AFixedBlockVector

By contrast to on heap vectors, off heap (or direct) vectors are bound to a block of direct memory reserved using a dedicated allocator. Currently, the project features a reference direct memory allocator for storing data off heap: UnsafeNativeMemoryAllocator. Though implemented in a straight-forward way, it still has several underlying chunks depending on the size of inner blocks it allocates.
The interface MemoryAllocator is the specification for any allocator tested in this project.

This allocator is used to implement Chunks, that represent an array of raw data. ActiveViam having goals to get the best of the machine performance, Chunks cannot have generic methods, not to pay the cost of boxing/unboxing. That's the main reason for the existence of Chunk. It provides read and write methods adapted for primitive types. In this scholar project, we only define methods for int and double.

Development environment

This project is written in Java 19, though it does not use many of the latest features so far. Particularly, implementation depending on project Panama features are to be implemented by the students.

It uses Maven to manage its dependencies.

JDK

Download JDK 19 from https://jdk.java.net/19/. When working for multiple java version, it's advised to use tools for version management. SDK Man is one of the most common one.

Compiling the project

mvn compile

Build print compilation warnings due to the usage of sun.misc.Unsafe. This is indeed an internal API but it has been accepted by many vendors. Project Panama aims at providing safer alternatives, but there are not ready yet.

Running unit tests

Testing f

mvn test

Tasks

  1. Implement a simple In-memory database (Mahieddine)
  2. Panama exploration
  • Check if we can load off-heap vectors directly into panama vector API (Foreign Memory API [example](see https://openjdk.org/jeps/424)) (students)
  • Create a dedicated off heap allocator using Segments (students)
  • Write test suite for vector operations (mahieddine)
  • Rewrite DirectDoubleVectorBlock and DirectIntegerVector operations using panama API (students)
  • Write a DirectMemoryAllocator using MemorySegments (students). It will be nice to compare allocation performance between the new allocator and the Unsafe allocator.
  1. Benchmark your code (can be done while implementing the prototype)
  • Use JMH. Additional, materials can be found on official JMH page.
  • Use JITWatch to analyze the HotSpotJIT compiler.
  • For further analysis, one can use Intel VTune profiler. Careful, it works only with Oracle or OpenJDK and on Linux only.
  • Virtual azure machine with SIMD instruction and benchmark template.
  1. Create new prototypes of Vector API

Useful Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages