Skip to content

Performance

Mark Papadakis edited this page Oct 3, 2017 · 3 revisions

Trinity is fast, and given its features-set, it may be the fastest such open sourced IR library.

Trinity queries are defined as ASTs, abstract syntax trees. AST nodes and other auxiliary state is allocated from a simple memory allocator that reserves memory in banks and allocations are served from it; in practice this means for a typical query there will be only one memory allocation required. Furthermore, it is trivial and very efficient to alter the query(AST), and otherwise operate on it.

In fact, this allocation strategy is employed throughout Trinity, so allocations are kept to a very low minimum.

The execution engine that runs queries against datasets will translate the input query to an executable/runnable representation, and in the course of doing so, will heavily optimise it so that as few as possible ‘instructions’ will be generated/emitted; they will be re-ordered, combined and broken down to micro-ops as needed for efficiency. Also, use of cache-friendly placement and allocations, prefetching and caching is used where appropriate for squeezing even more performance out of execution pipeline.

The bundled codecs are also optimised for both performance and space, using variable encoding and other encoding and storage schemas for fast postlists access.

Lastly, Trinity is written in optimised C++. I understand there people with very strong opinions about languages, and that the choice of a language doesn’t necessarily affect the performance, and resources footprint of an application or service, so draw your own conclusions from this statement:)

Clone this wiki locally