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

[NativeAOT-LLVM] Remove various file reading (Linux specific) paths #2952

Open
wants to merge 2 commits into
base: feature/NativeAOT-LLVM
Choose a base branch
from

Conversation

SingleAccretion
Copy link

@SingleAccretion SingleAccretion commented Jan 22, 2025

Fixes #2947. Includes a wasmjit-diff.ps1 change that makes it work with components.

Diffs (WasmDebugging):

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 772104
Total bytes of diff: 752689
Total bytes of delta: -19415 (-2.51% % of base)
Average relative delta: -5.53%
    diff is an improvement
    average relative diff is an improvement

Top method regressions (percentages):
          15 ( 5.70% of base) : 1002.dasm - GCToOSInterface::GetMemoryStatus(unsigned long long, unsigned int*, unsigned long long*, unsigned long long*)

Top method improvements (percentages):
        -658 (-99.70% of base) : 1003.dasm - InitializeCGroup()
        -263 (-98.50% of base) : 1004.dasm - GetPhysicalMemoryUsed(unsigned long*)
         -17 (-89.47% of base) : 1005.dasm - InitializeCpuCGroup()

Top methods only present in base:
          -3 (-100.00% of base) : 1000.dasm - undefined_weak:__wasilibc_find_relpath_alloc
         -52 (-100.00% of base) : 1027.dasm - __ofl_add
         -55 (-100.00% of base) : 1028.dasm - sscanf
         -36 (-100.00% of base) : 1029.dasm - fputs
        -174 (-100.00% of base) : 1030.dasm - scalbn
        -538 (-100.00% of base) : 1031.dasm - fmod
       -4811 (-100.00% of base) : 1032.dasm - __floatscan
       -1403 (-100.00% of base) : 1033.dasm - hexfloat
        -595 (-100.00% of base) : 1034.dasm - scanexp
        -402 (-100.00% of base) : 1035.dasm - mbrtowc
         -18 (-100.00% of base) : 1036.dasm - mbsinit
         -16 (-100.00% of base) : 1026.dasm - getline
       -3081 (-100.00% of base) : 1037.dasm - vfscanf
         -88 (-100.00% of base) : 1039.dasm - vsscanf
         -93 (-100.00% of base) : 1040.dasm - string_read
        -370 (-100.00% of base) : 1041.dasm - memchr
         -73 (-100.00% of base) : 1042.dasm - memcmp
         -24 (-100.00% of base) : 1043.dasm - strcat
         -29 (-100.00% of base) : 1044.dasm - strchr
        -360 (-100.00% of base) : 1045.dasm - strstr
        -178 (-100.00% of base) : 1046.dasm - fourbyte_strstr
       -1002 (-100.00% of base) : 1047.dasm - twoway_strstr
        -247 (-100.00% of base) : 1048.dasm - strspn
         -28 (-100.00% of base) : 1038.dasm - long_double_not_supported
        -240 (-100.00% of base) : 1049.dasm - strcspn
        -585 (-100.00% of base) : 1025.dasm - getdelim
        -389 (-100.00% of base) : 1023.dasm - __fdopen
        -404 (-100.00% of base) : 1001.dasm - GetAvailablePhysicalMemory()
        -267 (-100.00% of base) : 1006.dasm - CGroup::FindCGroupPath(bool (*)(char const*))
        -557 (-100.00% of base) : 1007.dasm - CGroup::FindHierarchyMount(bool (*)(char const*), char**, char**)
        -209 (-100.00% of base) : 1008.dasm - CGroup::FindCGroupPathForSubsystem(bool (*)(char const*))
        -112 (-100.00% of base) : 1009.dasm - read
         -17 (-100.00% of base) : 1010.dasm - __wasi_fd_fdstat_set_flags
        -101 (-100.00% of base) : 1024.dasm - fopen
         -37 (-100.00% of base) : 1012.dasm - __wasi_path_open
        -281 (-100.00% of base) : 1013.dasm - __wasilibc_nocwd_openat_nomode
         -21 (-100.00% of base) : 1011.dasm - __wasi_fd_read
         -93 (-100.00% of base) : 1015.dasm - __wasilibc_find_relpath
        -342 (-100.00% of base) : 1016.dasm - __wasilibc_find_abspath
          -2 (-100.00% of base) : 1017.dasm - dummy
        -151 (-100.00% of base) : 1018.dasm - fclose
        -101 (-100.00% of base) : 1019.dasm - __fmodeflags
        -274 (-100.00% of base) : 1020.dasm - fcntl
        -113 (-100.00% of base) : 1021.dasm - readv
        -252 (-100.00% of base) : 1022.dasm - __stdio_read
        -161 (-100.00% of base) : 1014.dasm - __wasilibc_open_nomode
        -107 (-100.00% of base) : 1050.dasm - strtok_r

51 total methods with Code Size differences (50 improved, 1 regressed)

@jkotas jkotas added the area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) label Jan 22, 2025
Utilizing 'wasm-tools unbundle'.

Also change how the debug test exclusion works so
that it is buildable in Release (useful for diffs).
This removes a bunch of libc stuff from HelloWorld,
in addition to removing the actual file opening.
@SingleAccretion
Copy link
Author

@dotnet/nativeaot-llvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants