Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Regenerate the merged single-header distribution after changing files in `src/`: `make build`
- Clean generated artifacts: `make clean`


## Repository structure

├── Makefile # Build Command
Expand Down Expand Up @@ -58,8 +59,26 @@ The main runtime flow is:
3. Use `exprtk::parser<T>` to tokenize and compile an expression string into an AST owned by the expression object.
4. Evaluate the compiled expression through `expression.value()` / `operator()`, which walks the compiled node tree.


## Working conventions for this repo

- Make changes in `src/` first. If public distribution output must stay in sync, regenerate top-level `exprtk.hpp` afterwards with `make build`.
- When changing parser or evaluation behavior, validate with `make exprtk_test && ./bin/exprtk_test`.
- When changing public API or examples-facing behavior, also build at least one relevant target from `example/` to confirm include-path and integration behavior still work.


## Benchmark progress

1. `make build` — sync top-level `exprtk.hpp` from `src/` when headers changed.
2. `make benchmark` — produce `./bin/exprtk_benchmark` (uses repo-root include path).
3. Append several timed runs to one log (example: 5 rounds, 1000 iterations each, feature is arena_allocator):

```bash
for i in $(seq 1 5); do
echo "## Base $i" >> benchmark_arena_allocator.md
./bin/exprtk_benchmark 1000 >> benchmark_arena_allocator.md 2>&1
echo >> benchmark_arena_allocator.md
done
```

4. After optimizations, repeat steps 1–2 and run the same loop with a new heading prefix (e.g. `## Optimized $i`) so before/after blocks stay in one file.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

COMPILER := -c++
COMPILER := c++
#COMPILER := -clang++
OPTIMIZATION_OPT := -O2 -DNDEBUG
BASE_OPTIONS := -pedantic-errors -Wall -Wextra -Werror -Wno-long-long
Expand All @@ -24,9 +24,16 @@ build:

all: $(BUILD_LIST)

test: $(TEST_SRC)
examples: $(EXAMPLE_SRC)

example: $(EXAMPLE_SRC)
# test/ would otherwise be picked up as this target; keep `make test` as a pure alias.
.PHONY: test
test: exprtk_test

benchmark: exprtk_benchmark.cpp src/exprtk.hpp
@mkdir -p $(BIN_DIR)
@echo "Building $(BIN_DIR)/exprtk_benchmark"
$(COMPILER) $(OPTIONS) -I. -o $(BIN_DIR)/exprtk_benchmark $< $(LINKER_OPT)

exprtk_%: exprtk_%.cpp src/exprtk.hpp
@mkdir -p $(BIN_DIR)
Expand Down
Loading