Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

56 lines (47 sloc) 1.75 KB


The purpose of this project is to compare/contrast java and clojure implementations of naive matching (stock) price engine.

Expected hyposis is that: 1. java implementation should be a bit faster (2-9 times) 2. clojure implementation should be much shorter and modular

Project structure

  • bin - fat jars for the implementations
  • jcmec - clojure implementation
    • builds with leiningen
    • uses ring (jetty 6x), moustache
  • jcmegen - clojure client that generates input, calls into web service/s, verifies and prints results
  • jcmej - java implementation
    • builds with maven
    • uses CXF (jetty 7x)
  • - bash script that builds the implementations
  • - bash script wrapper that invokes and then
  • config.clj - input configuration in clojure reader compatible format
  • - this file
  • run.bat - Windows version of
  • - invokes main of jcmegen against pre-build jars in bin

Matching engine requirements

  1. REST JSON interface
    • POST /match
      • json: orderId (B|S plus sequence number), price
    • GET /max/B|S
    • GET /results
    • GET /reset
  2. Support concurrent requests for match and get max buy and sell price.
  3. Return unmatched items.
  4. Reset internal state so matching session can be repeated.

To run

./ || run.bat

To build and run (if you made changes)

Make sure maven and leiningen are installed and on the PATH ./

Todo List

  1. Port the rest of bash scripts to Windows bat
  2. Implement scala version
  3. Implement haskell version
  4. Collect run statistics: jcmegen will call into public web app which will store and report on run statistics.


Copyright (C) 2011 Vitaly Peressada

Distributed under the Eclipse Public License, the same as Clojure.

Jump to Line
Something went wrong with that request. Please try again.