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

macho: make input object file descriptors short-lived #107

Closed
wants to merge 4 commits into from
Closed

Conversation

kubkon
Copy link
Owner

@kubkon kubkon commented Feb 5, 2024

This avoids issue described in ziglang/zig#18827

Incidentally improves time performance:

Benchmark 1: ./zld
  Time (mean ± σ):      5.896 s ±  0.031 s    [User: 4.228 s, System: 2.626 s]
  Range (min … max):    5.849 s …  5.950 s    10 runs

Benchmark 2: ./zld_old
  Time (mean ± σ):      7.126 s ±  0.260 s    [User: 4.854 s, System: 3.238 s]
  Range (min … max):    6.954 s …  7.632 s    10 runs

Summary
  ./zld ran
    1.21 ± 0.04 times faster than ./zld_old

at the cost of somewhat increased memory pressure: at 1459MB up from 1156MB.

I think this tradeoff is worth it, but happy to hear opinions.

EDIT: measurements taken on Intel MBP running macOS 13.6 with 8-core [email protected] and 32GB RAM.

EDIT2: On M1Pro MBP with 32GB RAM, 1466MB up from 1192MB, while benchmarks are:

Benchmark 1: ./zld
  Time (mean ± σ):      2.559 s ±  0.008 s    [User: 2.580 s, System: 0.778 s]
  Range (min … max):    2.548 s …  2.574 s    10 runs

Benchmark 2: ./zld_old
  Time (mean ± σ):      3.064 s ±  0.007 s    [User: 2.792 s, System: 1.067 s]
  Range (min … max):    3.050 s …  3.077 s    10 runs

Summary
  ./zld ran
    1.20 ± 0.00 times faster than ./zld_old

@kubkon
Copy link
Owner Author

kubkon commented Feb 5, 2024

Not sure how to reason about the memory value reported by tracy - I think it may include allocations done by itself in total memory usage which perhaps I should subtract from those values.

@kubkon
Copy link
Owner Author

kubkon commented Feb 6, 2024

Superseded #108

@kubkon kubkon closed this Feb 6, 2024
@kubkon kubkon deleted the macho-fds branch October 13, 2024 07:36
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.

1 participant