Skip to content

Commit

Permalink
Avoid calling to_list in _get_cc_info_linker_inputs for performance (#…
Browse files Browse the repository at this point in the history
…930)

This is slow for very large targets and slows down
`_apple_framework_packaging_impl`.

Before:
![Screenshot 2024-12-03 at 2 51
43 PM](https://github.com/user-attachments/assets/ad253422-9afb-4fed-aab9-cb835f9fe17b)



After:
![Screenshot 2024-12-03 at 2 53
10 PM](https://github.com/user-attachments/assets/c3a79512-dae1-4bbb-812a-fa469725528d)
  • Loading branch information
amorde authored Dec 4, 2024
1 parent c148e6a commit 77c4afa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rules/framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,9 @@ def _get_cc_info_linker_inputs(*, deps):
if not CcInfo in dep:
continue

for linker_input in dep[CcInfo].linking_context.linker_inputs.to_list():
linker_inputs.append(linker_input)
linker_inputs.append(dep[CcInfo].linking_context.linker_inputs)

return depset(linker_inputs)
return depset([], transitive = linker_inputs)

def _create_swiftmodule(attrs):
kwargs = {}
Expand Down

0 comments on commit 77c4afa

Please sign in to comment.