Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

rapidudf

> 后端框架
Open source

A High-Performance JIT-Based C++ Expression/Script Execution Engine with SIMD Vectorization Support

99 stars0 likes1 views
WebsiteGitHub

About

A High-Performance JIT-Based C++ Expression/Script Execution Engine with SIMD Vectorization Support

RapidUDF

RapidUDF is a high-performance SIMD vectorized expression/script computation execution engine library designed for online systems. It can be used in scenarios requiring high performance and flexibility such as rule engines, storage systems, and feature computation.

Limitations

  • C++17

Features

  • Easy to Use:
    • Provides support for conventional expression syntax
    • For more complex logic, supports a C-like DSL including if-elif-else* conditional control, while loop control, auto temporary variables, etc.;
    • For columnar memory data (vector), provides dynamic Table APIs similar to Spark's DataFrame and operations like filter/order_by/topk/take/group_by/concat/distinct/map/flatmap/merge;
  • High Performance:
    • Based on LLVM JIT compilation, startup and execution performance comparable to native cpp implementation;
    • For columnar memory data (vector), provides SIMD vectorization acceleration implementation
  • Thread Safe:
    • State-less JIT-generated C methods are naturally thread-safe
  • FFI:
    • Supports zero-cost access to C++ defined class objects (custom classes/stl/protobufs/flatbuffers/...) in expressions/UDFs
    • Supports zero-cost calls to methods/class methods defined in C++ within expressions/UDFs
  • Rich Built-in Data Types, Operators, and Functions:
    • built-in data types
    • built-in operators
    • built-in functions
  • Configurable Compilation:
    • Supports configurable LLVM optimization level, fast-math, and other compilation options

Compilation and Installation

Compilation requires a compiler that supports C++17

Bazel

Add in WORKSPACE:

python
    git_repository(
        name = "rapidudf",
        remote = "https://github.com/yinqiwen/rapidudf.git",
        commit = "...",
    )
    load("@rapidudf//:rapidudf.bzl", "rapidudf_workspace")
    rapidudf_workspace()

Add in the BUILD file for relevant code compilation rules:

python
cc_library(
    name = "mylib",
    srcs = ["mylib.cc"],
    hdrs = [
        "mylib.h",
    ],
    deps = [
        "@rapidudf",
    ],
)

CMake

First, compile and install rapidudf

bash
cd 
mkdir build; cd build;
cmake ..
make install

Add the following to the CMake configuration of the related project:

cmake
find_package(rapidudf REQUIRED)
....
# link rapidudf
target_link_libraries(mylib PRIVATE rapidudf::rapidudf)

Example

Usage Overview

Simple Expression

…

cpp #include "rapidudf/rapidudf.h"

using namespace rapidudf; struct Student { std::string name; uint16_t age = 0; float score = 0; bool gender = false; }; RUDF_STRUCT_FIELDS(Student, name, age, score, gender) int main() { // 1. Create table schema auto schema = table::TableSchema::GetOrCreate("Student", [](table::TableSchema* s) { std::ignore = s->AddColumns(); });

// 2. UDF string, table generic format where TABLE_NAME must match the previously created table schema name // table supports filter/order_by/topk/take/group_by/concat/distinct/map/flatmap/merge, etc. operations std::string source = R"( table select_students(Context ctx, table x) { auto filtered = x.filter(x.score >90 && x.age students; for (size_t i = 0; i NewTable(ctx); std::ignore = table->AddRows(students);

// 5. Execute function try { auto result_table = f(ctx, table.get()); auto result_scores = result_table->Get("score").value(); auto result_names = result_table->Get("name").value(); auto result_ages = result_table->Get("age").value(); auto result_genders = result_table->Get("gender").value(); for (size_t i = 0; i , std::vector, std::vector`.

Here is an example of creating a vector table based on Protobuf; Examples based on flatbuffers can be found in fbs_vector_table_udf; Examples based on struct can be found in struct_vector_table_udf;

…

Theoretically, the acceleration ratio should be the multiple of the AVX2 register width to the float width, which is 8; Actual results are as follows, showing that the acceleration ratio has exceeded 8 times, reaching 10.5:

Benchmark                               Time             CPU   Iterations
-------------------------------------------------------------------------
BM_native_wilson_ctr                69961 ns        69957 ns      9960
BM_rapidudf_vector_wilson_ctr       6661 ns         6659 ns       105270

Dependencies

  • LLVM 18+
  • highway 1.4.0
  • x86-simd-sort
  • sleef 3.9.0
  • fmtlib 11.0.2
  • spdlog 1.14.1
  • abseil-cpp 20250512.2
  • boost
    • preprocessor
    • parser
  • protobuf 3.19.2
  • flatbuffers 2.0.5
  • json 3.11.3

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++cppexpressionhigh-performancejit

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架