chore(ai): add comprehensive CLI configurations for all AI assistants
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
36
.qwen/scripts/math-optimize.sh
Executable file
36
.qwen/scripts/math-optimize.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/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"
|
||||
42
.qwen/scripts/math-test.sh
Executable file
42
.qwen/scripts/math-test.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# math-test.sh - Run comprehensive mathematical tests for Qwen Code
|
||||
|
||||
echo "Running comprehensive mathematical tests for Qwen Code..."
|
||||
|
||||
# Create results directory if it doesn't exist
|
||||
mkdir -p .qwen/results
|
||||
|
||||
# Run unit tests for mathematical functions
|
||||
echo "Running unit tests for mathematical functions..."
|
||||
go test -v ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-unit-tests.log
|
||||
|
||||
# Run property-based tests
|
||||
echo "Running property-based tests..."
|
||||
go test -v -run=Property ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-property-tests.log
|
||||
|
||||
# Run fuzz tests (limited time)
|
||||
echo "Running fuzz tests (60 seconds)..."
|
||||
timeout 60s go test -fuzz=Fuzz ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-fuzz-tests.log
|
||||
|
||||
# Run benchmarks
|
||||
echo "Running mathematical function benchmarks..."
|
||||
go test -bench=. -benchmem ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-benchmarks.log
|
||||
|
||||
# Run benchmarks with CPU profiling
|
||||
echo "Running benchmarks with CPU profiling..."
|
||||
go test -bench=. -cpuprofile=.qwen/results/cpu.prof ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-cpu-bench.log
|
||||
|
||||
# Run benchmarks with memory profiling
|
||||
echo "Running benchmarks with memory profiling..."
|
||||
go test -bench=. -memprofile=.qwen/results/mem.prof ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-mem-bench.log
|
||||
|
||||
# Check for errors
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "All mathematical tests completed successfully!"
|
||||
echo "Results saved to .qwen/results/"
|
||||
else
|
||||
echo "Some mathematical tests failed!"
|
||||
echo "Check .qwen/results/ for details"
|
||||
exit 1
|
||||
fi
|
||||
42
.qwen/scripts/perf-test.sh
Executable file
42
.qwen/scripts/perf-test.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# perf-test.sh - Run comprehensive performance tests for Qwen Code
|
||||
|
||||
echo "Running comprehensive mathematical performance tests for Qwen Code..."
|
||||
|
||||
# Create results directory if it doesn't exist
|
||||
mkdir -p .qwen/results
|
||||
|
||||
# Run unit tests for mathematical functions
|
||||
echo "Running unit tests for mathematical functions..."
|
||||
go test -v ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-unit-tests.log
|
||||
|
||||
# Run property-based tests
|
||||
echo "Running property-based tests..."
|
||||
go test -v -run=Property ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-property-tests.log
|
||||
|
||||
# Run fuzz tests (limited time)
|
||||
echo "Running fuzz tests (60 seconds)..."
|
||||
timeout 60s go test -fuzz=Fuzz ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-fuzz-tests.log
|
||||
|
||||
# Run benchmarks
|
||||
echo "Running mathematical function benchmarks..."
|
||||
go test -bench=. -benchmem ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-benchmarks.log
|
||||
|
||||
# Run benchmarks with CPU profiling
|
||||
echo "Running benchmarks with CPU profiling..."
|
||||
go test -bench=. -cpuprofile=.qwen/results/cpu.prof ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-cpu-bench.log
|
||||
|
||||
# Run benchmarks with memory profiling
|
||||
echo "Running benchmarks with memory profiling..."
|
||||
go test -bench=. -memprofile=.qwen/results/mem.prof ./pkg/uniswap/... ./pkg/math/... | tee .qwen/results/math-mem-bench.log
|
||||
|
||||
# Check for errors
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "All mathematical performance tests completed successfully!"
|
||||
echo "Results saved to .qwen/results/"
|
||||
else
|
||||
echo "Some mathematical performance tests failed!"
|
||||
echo "Check .qwen/results/ for details"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user