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

perf: lazy OSX frameworks with lzld #23716

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

littledivy
Copy link
Member

@littledivy littledivy commented May 6, 2024

$> otool -L target/release/deno
target/release/deno:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.61.1)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)

$> otool -L (which deno)
/Users/divy/.deno/bin/deno:
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 2420.0.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1226.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0, weak)
	/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 343.14.0, weak)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1774.4.3, weak)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders (compatibility version 1.0.0, current version 127.4.8, weak)

image

image

@littledivy littledivy changed the title perf: lazy OSX frameworks with lzld perf: lazy OSX frameworks with lzld [WIP] May 6, 2024
@littledivy littledivy changed the title perf: lazy OSX frameworks with lzld [WIP] perf: lazy OSX frameworks with lzld May 7, 2024
.cargo/config.toml Show resolved Hide resolved
tools/lzld/README.md Outdated Show resolved Hide resolved
tools/lzld/README.md Outdated Show resolved Hide resolved
tools/lzld/lzld.m Show resolved Hide resolved
tools/lzld/lzld Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be built during the rust build?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but it'll be pretty rarely updated. We should do it like N-API symbols list, which are rebuilt manually when there is a change.

Comment on lines +679 to +688
// For remote debugging only.
// {
// name: "Setup tmate session",
// if: [
// "(matrix.job == 'test' || matrix.job == 'bench') &&",
// "matrix.profile == 'debug' && (matrix.use_sysroot ||",
// "github.repository == 'denoland/deno')",
// ].join("\n"),
// uses: "mxschmitt/action-tmate@v3",
// },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this commented out in the codebase? Quite useful for debugging CI remotely :)

if (events.length > 2) break;
if (events.length >= 2) break;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny that this function name is getTwoEvents and waits for 3 instead. Spotted this bug by switching to the kqueue backend, nice.


// -- QuartzCore.framework

extern void *kCAGravityTopLeft = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this warning

~/src/deno/tools/lzld# make
cc -c lzld.m -o lzld.o
lzld.m:17:14: warning: 'extern' variable has an initializer [-Wextern-initializer]
extern void *kCAGravityTopLeft = 0;
             ^
1 warning generated.
ar rcs liblzld_arm64.a lzld.o

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.

None yet

2 participants