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

A note about file size differences #2

Closed
naratteu opened this issue Jan 20, 2025 · 0 comments
Closed

A note about file size differences #2

naratteu opened this issue Jan 20, 2025 · 0 comments

Comments

@naratteu
Copy link

I'm sorry for don`t translating it. To ensure there is no personal confusion in the memo.

안녕하세요! 저는 백엔드에서 자바스크립트 라이브러리를 사용하기위한 적절한 방법을 찾아보고있습니다.

jint ~> bun.js ~> dotnet-repl -> playwright -> PuppeteerAot -> puppeteer-sharp

동일코드에 대해서 puppeteer-aot와 puppeteer-sharp 이 동일하게 동작하는것을 확인하였으나,
출력된 파일 사이즈에서 미묘한 차이가 발생함음 확인했습니다.

Image

900KB미만의 작은 차이지만, 포크된 라이브러리라는것을 감안했을때 어째서 이런 차이가 보여지는지 궁금합니다.
받아들여야할 기능적 차이가 생긴것인지? puppeteer-sharp에 최적화의 여지가 있는것인지?

참조한 각 라이브러리와 코드는 아래와 같습니다.

<PackageReference Include="PuppeteerAot" Version="16.2.0" />
<PackageReference Include="PuppeteerSharp" Version="20.0.5" />
var browserFetcher = new BrowserFetcher();
await browserFetcher.DownloadAsync();
await using var browser = await Puppeteer.LaunchAsync(new());
await using var page = await browser.NewPageAsync();

var json = await page.EvaluateFunctionAsync<System.Text.Json.JsonElement>("""
        async function() {
            const { Packer, pack, unpack } = await import("https://esm.sh/peerjs-js-binarypack");
            var p = pack({a:10});
            return { pack: [...new Uint8Array(p)], unpack: unpack(p) }
        }
        """);
Console.WriteLine(json);
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

No branches or pull requests

1 participant