Skip to content

simpleyetawesomeprojects/Chimera4j

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chimera4j

Chimera4j allows you to run full PCRE compliant regexes in the JVM (up to 8 times faster than native PCRE). It is essentially just a wrapper for Chimera. Currently, the project is a bit of a super hacky prototype, but it is tested fairly well and appears to work... so that's kinda nice.

This project is based off the fine work of the folks over at hyperscan-java, which is a wrapper for Hyperscan.

Installation

Gradle

compile 'com.rivdata:Chimera4j:0.2.0'

sbt

libraryDependencies += "com.rivdata" % "Chimera4j" % "0.2.0"

Usage

Check out the tests.

What's the current state of the code?

Code is just a proof of concept that we can use Hyperscan 5 and Chimera with Java. We need to validate that's compatible with all PCRE regexes before committing to a full development.

Be wary of the following pitfalls:

  1. Be afraid of the natives. I built the darwin ones on my personal computer, the linux ones I built in docker. If you get any errors, these natives are likely the cause. Since they run very differently depending on the hardware you are running on, make sure to test your production environments, or better yet, keep this library out of production altogether.
  2. The libchimera.so and libchimera.dylib filenames are a bit misleading. In truth, they are actually dynamic libs that link chimera, hyperscan and PCRE together into a FAT executable.
  3. The pure Hyperscan .dylib file in here is useless, but I'm leaving it in because the code references it in a ton of places. All the functionality it provides is duplicated in the chimera.dylib.

About

Run Chimera and Hyperscan 5 in Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.5%
  • Dockerfile 0.5%