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

ci: improve macOS build #414

Merged
merged 5 commits into from
Jul 12, 2024
Merged

ci: improve macOS build #414

merged 5 commits into from
Jul 12, 2024

Conversation

gnattu
Copy link
Member

@gnattu gnattu commented Jul 12, 2024

Current macOS build enabled glib integration for harfbuzz which is not enabled anywhere else. Disable that to reduce dependency maintenance work and to match other platforms.

Current Xcode no longer need the ld-classic to statically link ffmpeg. Commented out that workarond

Prefer macOS native vDSP instead of fftw as the fft library, which is faster especially on Apple Silicon:

Theoretical benchmark:

| input len  |real FFTPack|  real vDSP |  real FFTW | real PFFFT |cplx FFTPack|  cplx vDSP |  cplx FFTW | cplx PFFFT |
|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|
|       64   |     5972   |    14009   |    10515   |    17014   |    10367   |    29901   |    21453   |    28700   |
|       96   |     9004   |      n/a   |     7547   |    26715   |    10788   |      n/a   |    21132   |    32847   |
|      128   |    11576   |    34515   |    20036   |    31728   |    12345   |    52737   |    26388   |    36729   |
|      160   |    11709   |      n/a   |    17964   |    34571   |    12242   |      n/a   |    25649   |    34808   |
|      192   |    12370   |      n/a   |    18478   |    37183   |    13631   |      n/a   |    24193   |    39139   |
|      256   |    13830   |    46503   |    21746   |    41290   |    14828   |    62668   |    25918   |    42693   |
|      384   |    11746   |      n/a   |    22112   |    40816   |    12005   |      n/a   |    25244   |    39474   |
|      480   |    11565   |      n/a   |    17623   |    41591   |    11865   |      n/a   |    24625   |    36698   |
|      512   |    12800   |    35865   |    23054   |    43769   |    12872   |    76443   |    28536   |    41679   |
|      640   |    12603   |      n/a   |    23183   |    44242   |    12767   |      n/a   |    28944   |    39263   |
|      768   |    13147   |      n/a   |    23216   |    46486   |    13383   |      n/a   |    26359   |    43120   |
|      800   |    12369   |      n/a   |    16751   |    42232   |    12178   |      n/a   |    17250   |    37170   |
|     1024   |    13925   |    47128   |    24097   |    48911   |    14263   |    91526   |    29764   |    45519   |
|     2048   |    13292   |    55630   |    25125   |    49077   |    13481   |    98913   |    30542   |    43870   |
|     2400   |    12381   |      n/a   |    17182   |    43580   |    12195   |      n/a   |    17909   |    37607   |
|     4096   |    14605   |    64053   |    25213   |    52085   |    14536   |   103574   |    30579   |    46363   |
|     8192   |    13542   |    70725   |    25111   |    49489   |    13073   |    82653   |    29616   |    40289   |
|     9216   |    12972   |      n/a   |    24937   |    48236   |    12693   |      n/a   |    26502   |    38886   |
|    16384   |    13952   |    62492   |    25666   |    47082   |    13440   |    78213   |    26654   |    37765   |
|    32768   |    12125   |    60109   |    23923   |    32701   |    11112   |    69972   |    15829   |    35574   |
|   262144   |    11871   |    52171   |    18506   |    34532   |    10990   |    63489   |    17092   |    36344   |
|  1048576   |    11221   |    38515   |    17862   |    31120   |     9043   |    32760   |    13568   |    31639   |
 (numbers are given in MFlops)

Actual perf in ffmpeg chromaprint:

Tested with ffmpeg -f lavfi -i "sine=frequency=1000:duration=7200" -f chromaprint -fp_format raw /dev/null -benchmark

current fftw3f:

size=     227kB time=01:59:59.99 bitrate=   0.3kbits/s speed=2.86e+03x
video:0kB audio:620156kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
bench: utime=3.228s stime=0.914s rtime=2.517s
bench: maxrss=14893056kB

vDSP:

size=     227kB time=01:59:59.99 bitrate=   0.3kbits/s speed=3.47e+03x
video:0kB audio:620156kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
bench: utime=2.514s stime=0.913s rtime=2.072s
bench: maxrss=14352384kB

Changes

  • Removed glib and pcre2 dependency on macOS
  • Correctly disabled libx11 on macOS
  • Commented out linker workaround for Xcode 15
  • use vDSP instead of fftw on macOS

Issues

@gnattu gnattu requested a review from a team July 12, 2024 07:49
@gnattu gnattu merged commit d80bee1 into jellyfin Jul 12, 2024
11 of 20 checks passed
@nyanmisaka nyanmisaka deleted the macos-ci-enhancement branch July 14, 2024 11:18
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.

3 participants