Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
36 lines
1.5 KiB
Bash
Executable File
36 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# math-optimize.sh - Optimize mathematical functions for Qwen Code
|
|
|
|
echo "Optimizing mathematical functions for Qwen Code..."
|
|
|
|
# Create results directory if it doesn't exist
|
|
mkdir -p .qwen/results
|
|
|
|
# Run benchmarks to establish baseline
|
|
echo "Establishing performance baseline..."
|
|
go test -bench=. -benchmem ./pkg/uniswap/... ./pkg/math/... > .qwen/results/baseline-benchmarks.log
|
|
|
|
# Run CPU profiling
|
|
echo "Running CPU profiling..."
|
|
go test -bench=. -cpuprofile=.qwen/results/baseline-cpu.prof ./pkg/uniswap/... ./pkg/math/... > .qwen/results/baseline-cpu.log
|
|
|
|
# Run memory profiling
|
|
echo "Running memory profiling..."
|
|
go test -bench=. -memprofile=.qwen/results/baseline-mem.prof ./pkg/uniswap/... ./pkg/math/... > .qwen/results/baseline-mem.log
|
|
|
|
# Analyze profiling results
|
|
echo "Analyzing profiling results..."
|
|
go tool pprof -top .qwen/results/baseline-cpu.prof > .qwen/results/cpu-top.log
|
|
go tool pprof -top .qwen/results/baseline-mem.prof > .qwen/results/mem-top.log
|
|
|
|
# Generate flame graphs (if go-torch is available)
|
|
if command -v go-torch &> /dev/null; then
|
|
echo "Generating flame graphs..."
|
|
go-torch .qwen/results/baseline-cpu.prof > .qwen/results/cpu-flame.svg
|
|
go-torch --alloc_objects .qwen/results/baseline-mem.prof > .qwen/results/mem-flame.svg
|
|
fi
|
|
|
|
echo "Mathematical optimization analysis complete!"
|
|
echo "Baseline results saved to .qwen/results/"
|
|
echo "Review .qwen/results/cpu-top.log and .qwen/results/mem-top.log for optimization opportunities" |