Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix preprocessor memory leaks and hideset crash #696

Merged
merged 2 commits into from
May 3, 2024

Conversation

ehaas
Copy link
Collaborator

@ehaas ehaas commented May 2, 2024

No description provided.

ehaas added 2 commits May 2, 2024 16:49
This fixes a crash where the set intersection would be larger
than min(a_len, b_len) because of duplicated items in one of
the sets
@ehaas
Copy link
Collaborator Author

ehaas commented May 2, 2024

The hideset fix makes things a bit faster (top is baseline, bottom is with the fix; preprocessor-only for zig2.c)

Benchmark 1 (3 runs): /home/ehaas/source/arocc/zig-out/bin/arocc-base -E -I/usr/lib/gcc/x86_64-linux-gnu/10/include -I/home/ehaas/source/zig/lib /home/ehaas/source/zig/build/zig2.c
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          3.89s  ± 12.8ms    3.88s  … 3.91s           0 ( 0%)        0%
  peak_rss           1.24GB ± 92.2KB    1.24GB … 1.24GB          0 ( 0%)        0%
  cpu_cycles         13.9G  ± 52.6M     13.9G  … 14.0G           0 ( 0%)        0%
  instructions       40.9G  ± 15.3      40.9G  … 40.9G           0 ( 0%)        0%
  cache_references   44.5M  ±  725K     44.1M  … 45.4M           0 ( 0%)        0%
  cache_misses       18.9M  ±  116K     18.8M  … 19.0M           0 ( 0%)        0%
  branch_misses      68.2M  ±  182K     68.0M  … 68.3M           0 ( 0%)        0%
Benchmark 2 (3 runs): /home/ehaas/source/arocc/zig-out/bin/arocc -E -I/usr/lib/gcc/x86_64-linux-gnu/10/include -I/home/ehaas/source/zig/lib /home/ehaas/source/zig/build/zig2.c
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          3.68s  ± 11.5ms    3.67s  … 3.69s           0 ( 0%)        ⚡-  5.4% ±  0.7%
  peak_rss           1.15GB ± 20.6KB    1.15GB … 1.15GB          0 ( 0%)        ⚡-  7.5% ±  0.0%
  cpu_cycles         13.3G  ± 38.7M     13.2G  … 13.3G           0 ( 0%)        ⚡-  4.8% ±  0.8%
  instructions       39.6G  ± 69.8      39.6G  … 39.6G           0 ( 0%)        ⚡-  3.2% ±  0.0%
  cache_references   36.1M  ±  376K     35.8M  … 36.5M           0 ( 0%)        ⚡- 19.0% ±  2.9%
  cache_misses       14.5M  ±  114K     14.4M  … 14.6M           0 ( 0%)        ⚡- 23.2% ±  1.4%
  branch_misses      67.2M  ± 44.5K     67.2M  … 67.3M           0 ( 0%)          -  1.4% ±  0.4%

@Vexu Vexu merged commit f9444f6 into Vexu:master May 3, 2024
3 checks passed
@ehaas ehaas deleted the preprocessor-fixes branch May 3, 2024 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants