File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 - name : Build optimized version
3030 run : |
3131 # Build library and test binary with release optimization
32- make release
33- make tests
32+ make tests-release
3433
3534 - name : Run performance tests
3635 run : |
@@ -39,11 +38,11 @@ jobs:
3938
4039 # Time the test execution
4140 echo "## Test Suite Performance"
42- /usr/bin/time -v ./bin/bin_tests 2>&1 | tee benchmark_results.txt
41+ /usr/bin/time -v ./bin/bin_tests_release 2>&1 | tee benchmark_results.txt
4342
4443 echo "## Memory Usage Analysis"
4544 echo "Binary sizes:"
46- ls -lh build/libbin .so bin/bin_tests
45+ ls -lh build/libbin_release .so bin/bin_tests_release
4746
4847 echo "## Library Metrics"
4948 echo "Source lines of code:"
Original file line number Diff line number Diff line change @@ -133,8 +133,12 @@ jobs:
133133 echo "Checking for bitwise operators (forbidden by educational constraints):"
134134
135135 # Check for actual bitwise operators (the ones we want to avoid)
136- # Use sed to strip all comments before checking
137- BITWISE_VIOLATIONS=$(find src/ -name "*.c" -o -name "*.h" | xargs sed -e 's|//.*||g' -e 's|/\*.*\*/||g' | grep -n -E '(\&[^&]|\|[^|]|\^|<<|>>|~)' | grep -v '&&' | grep -v '||' || true)
136+ # Use a more robust approach to strip comments
137+ BITWISE_VIOLATIONS=$(find src/ -name "*.c" -o -name "*.h" | while read file; do
138+ # Remove all types of C comments, then check for violations
139+ # This handles both // and /* */ comments properly
140+ perl -pe 's|//.*||g; s|/\*.*?\*/||gs' "$file" | grep -n -E '(\&[^&]|\|[^|]|\^|<<|>>|~)' | grep -v '&&' | grep -v '||' | sed "s|^|$file:|" || true
141+ done)
138142
139143 BITWISE_COUNT=$(echo "$BITWISE_VIOLATIONS" | grep -c . 2>/dev/null || true)
140144 if [ -z "$BITWISE_COUNT" ] || [ "$BITWISE_COUNT" = "" ]; then
Original file line number Diff line number Diff line change @@ -118,7 +118,11 @@ jobs:
118118
119119 # Check for bitwise operators (should be forbidden by project rules)
120120 echo "### Bitwise operators:"
121- BITWISE_VIOLATIONS=$(find src/ -name "*.c" -o -name "*.h" | xargs sed -e 's|//.*||g' -e 's|/\*.*\*/||g' | grep -n -E '(\&[^&]|\|[^|]|\^|<<|>>|~)' | grep -v '&&' | grep -v '||' || true)
121+ BITWISE_VIOLATIONS=$(find src/ -name "*.c" -o -name "*.h" | while read file; do
122+ # Remove all types of C comments, then check for violations
123+ # This handles both // and /* */ comments properly
124+ perl -pe 's|//.*||g; s|/\*.*?\*/||gs' "$file" | grep -n -E '(\&[^&]|\|[^|]|\^|<<|>>|~)' | grep -v '&&' | grep -v '||' | sed "s|^|$file:|" || true
125+ done)
122126
123127 BITWISE_COUNT=$(echo "$BITWISE_VIOLATIONS" | grep -c . 2>/dev/null || true)
124128 if [ -z "$BITWISE_COUNT" ] || [ "$BITWISE_COUNT" = "" ]; then
You can’t perform that action at this time.
0 commit comments