Skip to content

Use fork-sync for Folly and FastFloat#15979

Open
vmoroz wants to merge 3 commits intomicrosoft:mainfrom
vmoroz:PR/fork-sync-folly
Open

Use fork-sync for Folly and FastFloat#15979
vmoroz wants to merge 3 commits intomicrosoft:mainfrom
vmoroz:PR/fork-sync-folly

Conversation

@vmoroz
Copy link
Copy Markdown
Member

@vmoroz vmoroz commented Apr 10, 2026

Description

Type of Change

  • New feature (non-breaking change which adds functionality)

Why

This is Phase 2 of the fork-sync migration (Phase 1 PR landed fmt). Currently, Folly and FastFloat sources are downloaded at build time from GitHub, unzipped into node_modules/, and then patched in-place. This approach is fragile, makes offline builds impossible, and hides the actual source code that ships in the binary.

By committing the vendored source directly — with patches already applied — we get:

  • Reproducible builds — no network dependency for third-party source
  • Visible patches — Windows-specific changes are in the committed tree, reviewable in normal diffs
  • Simpler build — no download/unzip/patch targets; sources compile via shared .vcxitems
  • Automated sync@rnx-kit/fork-sync can update to new upstream versions and flag merge conflicts with our patches

What

Folly 2024.10.14.00 committed into vnext/external/folly/ (797 files, ~9 MB):

  • Full source trimmed to only the 12 subdirectories RNW actually uses (chrono, concurrency, container, detail, functional, hash, json, lang, memory, portability, synchronization, system) plus algorithm/simd/
  • 33 unused subdirectories excluded via .syncignore (coro, executors, fibers, futures, io, logging, etc.)
  • 10 Windows patches from TEMP_UntilFollyUpdate/ applied in-place
  • folly.vcxitems with 30 ClCompile entries, PCH support, Desktop-only SysMman.cpp
  • Object filename overrides to avoid collisions (folly_pch.obj, folly_Format.obj, portabilityString.obj)

FastFloat 8.0.0 committed into vnext/external/fast-float/ (13 files, header-only):

  • fast-float.vcxitems with ClInclude entries only

Build system changes:

  • React.Cpp.props — include paths changed from $(FollyDir) / $(FastFloatDir) to $(ExternalDir)folly / $(ExternalDir)fast-float\include
  • Directory.Build.props — removed 6 properties: FollyVersion, FastFloatVersion, FollyCommitHash, FastFloatCommitHash, FollyDir, FastFloatDir
  • External.vcxitems — imports folly.vcxitems and fast-float.vcxitems
  • Layout-Desktop-Headers.ps1 — uses committed source; removed download logic and override section

Cleanup:

  • Deleted vnext/Folly/Folly.vcxproj, .vcxproj.filters, cgmanifest.json, .clang-format, packages.lock.json
  • Deleted vnext/Folly/TEMP_UntilFollyUpdate/ (patches now in-place)
  • Deleted vnext/FollyWin32/ entirely (SysMman.cpp now in folly.vcxitems with AppContainerApplication condition)
  • Moved Folly.natvis to vnext/external/folly/
  • Kept vnext/Folly/pch.h, pch.cpp, ThreadNameStub.cpp (RNW-specific, referenced from vcxitems)
  • Removed Folly/FollyWin32 from 12 .sln files, 2 .slnf files
  • Removed ProjectReference to Folly from 4 .vcxproj files (Microsoft.ReactNative, ReactCommon, Desktop, IntegrationTests)
  • Updated sync-manifest.json with folly and fast-float entries
  • Added DisableFormat: true .clang-format inside folly/folly/ to prevent yarn format from reformatting vendored code

Screenshots

N/A — build infrastructure change, no UI impact.

Testing

  • Built Microsoft.ReactNative.vcxproj (Debug|x64) — all Folly sources compile via vcxitems chain, links successfully into Microsoft.ReactNative.dll
  • Built React.Windows.Desktop.DLL.vcxproj (Debug|x64) — SysMman.cpp compiles for Desktop, links into react-native-win32.dll
  • Verified no stale references to $(FollyDir), $(FastFloatDir), FollyVersion, FastFloatVersion, FollyCommitHash, FastFloatCommitHash remain in build files
  • Verified Folly.vcxproj is removed from all solutions

Changelog

Should this change be included in the release notes: no
Internal build infrastructure change — no API or behavior changes.

Microsoft Reviewers: Open in CodeFlow

@vmoroz vmoroz requested review from a team as code owners April 10, 2026 01:16
@vmoroz vmoroz force-pushed the PR/fork-sync-folly branch from d8e8af1 to a1871f1 Compare April 10, 2026 01:17
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Performance Test Results

Branch: PR/fork-sync-folly
Commit: d04d75ca
Time: 2026-04-10T18:27:50.126Z
Tests: 161/161 passed

✅ Passed

161 scenario(s) across 28 suite(s) — no regressions

SectionList

Scenario Mean Median StdDev Renders vs Baseline
SectionList mount 4.50ms 4.00ms ±2.07ms 1 -20.0%
SectionList unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
SectionList rerender 11.50ms 11.00ms ±2.27ms 2 +4.8%
SectionList with-3-sections-15-items 5.40ms 5.50ms ±1.17ms 1 +0.0%
SectionList with-5-sections-50-items 5.10ms 5.00ms ±0.74ms 1 -16.7%
SectionList with-10-sections-200-items 4.90ms 4.50ms ±1.29ms 1 -18.2%
SectionList with-20-sections-200-items 5.60ms 4.50ms ±2.88ms 1 -10.0%
SectionList with-section-separator 2.80ms 3.00ms ±0.63ms 1 +50.0%
SectionList with-item-separator 3.00ms 2.50ms ±1.76ms 1 +25.0%
SectionList with-header-footer 2.00ms 2.00ms ±0.67ms 1 +0.0%
SectionList with-section-footer 1.50ms 1.50ms ±0.53ms 1 -25.0%
SectionList with-sticky-section-headers 1.60ms 1.00ms ±0.97ms 1 -50.0%
SectionList with-empty-list 0.30ms 0.00ms ±0.48ms 1 -100.0%
SectionList with-50-sections-1000-items 1.70ms 2.00ms ±0.48ms 1 +0.0%

FlatList

Scenario Mean Median StdDev Renders vs Baseline
FlatList mount 4.40ms 4.00ms ±0.70ms 1 +0.0%
FlatList unmount 0.20ms 0.00ms ±0.42ms 0 +0.0%
FlatList rerender 10.20ms 10.00ms ±1.93ms 2 +11.1%
FlatList with-10-items 4.50ms 4.00ms ±0.97ms 1 +0.0%
FlatList with-100-items 5.20ms 5.00ms ±1.62ms 1 +0.0%
FlatList with-500-items 5.40ms 5.50ms ±1.17ms 1 +37.5%
FlatList with-1000-items 4.70ms 4.00ms ±1.70ms 1 +0.0%
FlatList horizontal 4.00ms 4.00ms ±1.25ms 1 -20.0%
FlatList with-separator 1.90ms 1.50ms ±1.52ms 1 -25.0%
FlatList with-header-footer 1.20ms 1.00ms ±0.42ms 1 -50.0%
FlatList with-empty-list 0.40ms 0.00ms ±0.52ms 1 -100.0%
FlatList with-get-item-layout 1.50ms 1.50ms ±0.53ms 1 +50.0%
FlatList inverted 1.30ms 1.00ms ±0.48ms 1 -33.3%
FlatList with-num-columns 2.50ms 2.50ms ±0.53ms 1 -16.7%

TouchableOpacity

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity mount 0.90ms 1.00ms ±0.32ms 1 +0.0%
TouchableOpacity unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TouchableOpacity rerender 1.90ms 2.00ms ±0.32ms 2 +100.0%
TouchableOpacity custom-active-opacity 0.50ms 0.50ms ±0.53ms 1 -50.0%
TouchableOpacity disabled 0.70ms 1.00ms ±0.48ms 1 +0.0%
TouchableOpacity with-all-handlers 0.70ms 1.00ms ±0.48ms 1 +0.0%
TouchableOpacity with-hit-slop 0.90ms 1.00ms ±0.57ms 1 +0.0%
TouchableOpacity with-delay 0.40ms 0.00ms ±0.52ms 1 -100.0%
TouchableOpacity nested 1.20ms 1.00ms ±0.42ms 1 +0.0%
TouchableOpacity multiple-10 5.80ms 5.00ms ±2.60ms 1 -16.7%
TouchableOpacity multiple-50 25.40ms 25.00ms ±3.20ms 1 -13.8%
TouchableOpacity multiple-100 31.73ms 27.00ms ±13.54ms 1 -46.0%

ScrollView

Scenario Mean Median StdDev Renders vs Baseline
ScrollView mount 0.30ms 0.00ms ±0.48ms 1 +0.0%
ScrollView unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
ScrollView rerender 0.50ms 0.00ms ±0.71ms 2 -100.0%
ScrollView children-20 2.87ms 3.00ms ±0.64ms 1 -25.0%
ScrollView children-100 17.07ms 16.00ms ±3.90ms 1 +0.0%
ScrollView horizontal 3.60ms 3.00ms ±0.84ms 1 -25.0%
ScrollView sticky-headers 2.50ms 3.00ms ±0.85ms 1 +0.0%
ScrollView scroll-indicators 0.60ms 1.00ms ±0.52ms 1 +0.0%
ScrollView nested 1.40ms 1.00ms ±0.70ms 1 +0.0%
ScrollView content-container-style 0.90ms 1.00ms ±0.32ms 1 +0.0%
ScrollView children-500 21.40ms 21.00ms ±5.26ms 1 +10.5%

TouchableHighlight

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight mount 0.40ms 0.00ms ±0.52ms 1 -100.0%
TouchableHighlight unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TouchableHighlight rerender 0.70ms 1.00ms ±0.48ms 2 +0.0%
TouchableHighlight custom-underlay-color 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight custom-active-opacity 0.90ms 0.50ms ±1.52ms 1 +Infinity%
TouchableHighlight disabled 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight with-all-handlers 0.20ms 0.00ms ±0.42ms 1 +0.0%
TouchableHighlight with-hit-slop 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight nested-touchables 0.90ms 1.00ms ±0.32ms 1 +0.0%
TouchableHighlight multiple-touchables-10 3.10ms 3.00ms ±0.74ms 1 +0.0%
TouchableHighlight multiple-touchables-50 12.30ms 12.00ms ±2.06ms 1 -4.0%
TouchableHighlight multiple-touchables-100 23.80ms 22.50ms ±4.08ms 1 +0.0%

Pressable

Scenario Mean Median StdDev Renders vs Baseline
Pressable mount 0.40ms 0.00ms ±0.52ms 1 +0.0%
Pressable unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Pressable rerender 0.50ms 0.50ms ±0.53ms 2 +0.0%
Pressable with-all-handlers 0.40ms 0.00ms ±0.52ms 1 +0.0%
Pressable with-style-function 0.20ms 0.00ms ±0.42ms 1 +0.0%
Pressable disabled 0.40ms 0.00ms ±0.52ms 1 +0.0%
Pressable with-hit-slop 0.30ms 0.00ms ±0.48ms 1 +0.0%
Pressable nested 0.60ms 1.00ms ±0.52ms 1 +0.0%
Pressable multiple-10 2.93ms 3.00ms ±0.70ms 1 +0.0%
Pressable multiple-50 19.27ms 16.00ms ±12.24ms 1 +14.3%
Pressable multiple-100 19.53ms 11.00ms ±15.80ms 1 -8.3%

Modal

Scenario Mean Median StdDev Renders vs Baseline
Modal mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Modal rerender 0.20ms 0.00ms ±0.42ms 2 +0.0%
Modal slide-animation 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal fade-animation 0.30ms 0.00ms ±0.48ms 1 +0.0%
Modal transparent 0.30ms 0.00ms ±0.48ms 1 +0.0%
Modal with-callbacks 0.10ms 0.00ms ±0.32ms 1 +0.0%
Modal rich-content 1.90ms 2.00ms ±0.74ms 1 +0.0%
Modal with-accessibility 0.30ms 0.00ms ±0.48ms 1 +0.0%

Image

Scenario Mean Median StdDev Renders vs Baseline
Image mount 0.00ms 0.00ms ±0.00ms 1 +0.0%
Image unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Image rerender 0.10ms 0.00ms ±0.32ms 2 +0.0%
Image with-resize-mode 0.30ms 0.00ms ±0.48ms 1 +0.0%
Image with-border-radius 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image with-tint-color 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-blur-radius 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-accessibility 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image multiple-10 0.87ms 1.00ms ±0.35ms 1 +0.0%
Image multiple-50 3.27ms 3.00ms ±0.59ms 1 +0.0%
Image multiple-100 8.20ms 7.00ms ±1.74ms 1 -12.5%

ActivityIndicator

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
ActivityIndicator rerender 0.00ms 0.00ms ±0.00ms 2 +0.0%
ActivityIndicator size-large 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator size-small 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator with-color 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator not-animating 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator with-accessibility 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator multiple-10 0.87ms 1.00ms ±0.35ms 1 +0.0%
ActivityIndicator multiple-50 3.40ms 3.00ms ±0.83ms 1 -25.0%
ActivityIndicator multiple-100 8.27ms 8.00ms ±1.94ms 1 +14.3%

Switch

Scenario Mean Median StdDev Renders vs Baseline
Switch mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Switch rerender 0.30ms 0.00ms ±0.48ms 2 -100.0%
Switch value-true 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch disabled 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch custom-colors 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch on-value-change 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch with-accessibility 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch multiple-10 1.33ms 1.00ms ±0.49ms 1 -50.0%
Switch multiple-50 8.80ms 7.00ms ±2.76ms 1 -22.2%
Switch multiple-100 18.00ms 18.00ms ±4.39ms 1 +12.5%

Button

Scenario Mean Median StdDev Renders vs Baseline
Button mount 0.50ms 0.50ms ±0.53ms 1 -50.0%
Button unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Button rerender 1.10ms 1.00ms ±0.32ms 2 +0.0%
Button disabled 0.50ms 0.50ms ±0.53ms 1 -50.0%
Button with-color 0.70ms 1.00ms ±0.48ms 1 +100.0%
Button with-accessibility 0.50ms 0.50ms ±0.53ms 1 -50.0%
Button multiple-10 5.73ms 5.00ms ±1.83ms 1 -16.7%
Button multiple-50 21.40ms 23.00ms ±7.27ms 1 -14.8%
Button multiple-100 15.73ms 16.00ms ±3.83ms 1 -15.8%

TextInput

Scenario Mean Median StdDev Renders vs Baseline
TextInput mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
TextInput unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TextInput rerender 0.30ms 0.00ms ±0.48ms 2 +0.0%
TextInput multiline 0.10ms 0.00ms ±0.32ms 1 +0.0%
TextInput with-value 0.20ms 0.00ms ±0.42ms 1 +0.0%
TextInput styled 0.20ms 0.00ms ±0.42ms 1 +0.0%
TextInput multiple-100 7.87ms 7.00ms ±2.23ms 1 +0.0%

View

Scenario Mean Median StdDev Renders vs Baseline
View mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
View unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
View rerender 0.30ms 0.00ms ±0.48ms 2 +0.0%
View nested-50 3.20ms 3.00ms ±0.41ms 1 +0.0%
View nested-100 8.27ms 7.00ms ±2.15ms 1 +0.0%
View shadow 0.20ms 0.00ms ±0.42ms 1 +0.0%
View border-radius 0.20ms 0.00ms ±0.42ms 1 +0.0%
View nested-500 18.33ms 11.00ms ±14.39ms 1 +10.0%

Text

Scenario Mean Median StdDev Renders vs Baseline
Text mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Text unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Text rerender 0.10ms 0.00ms ±0.32ms 2 +0.0%
Text long-1000 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text nested 0.30ms 0.00ms ±0.48ms 1 +0.0%
Text styled 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text multiple-100 7.73ms 7.00ms ±1.71ms 1 +0.0%

SectionList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
SectionList native mount 6.48ms 6.10ms ±1.16ms 1 -6.1%

FlatList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
FlatList native mount 5.84ms 5.71ms ±1.00ms 1 -38.1%

TouchableHighlight.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight native mount 1.81ms 1.76ms ±0.20ms 1 -15.7%

TouchableOpacity.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity native mount 2.40ms 2.41ms ±0.39ms 1 -23.1%

Pressable.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Pressable native mount 2.10ms 1.86ms ±0.82ms 1 -25.8%

ScrollView.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ScrollView native mount 5.54ms 5.44ms ±0.74ms 1 +34.3%

ActivityIndicator.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator native mount 1.60ms 1.50ms ±0.27ms 1 -39.5%

TextInput.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TextInput native mount 2.28ms 2.23ms ±0.22ms 1 -45.4%

Switch.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Switch native mount 1.44ms 1.36ms ±0.24ms 1 -21.8%

Button.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Button native mount 2.13ms 2.07ms ±0.32ms 1 -20.6%

Modal.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Modal native mount 1.36ms 1.30ms ±0.35ms 1 +7.1%

Image.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Image native mount 2.30ms 2.10ms ±0.73ms 1 -6.9%

View.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
View native mount 1.50ms 1.39ms ±0.43ms 1 -2.8%

Text.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Text native mount 1.58ms 1.53ms ±0.24ms 1 -12.1%

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.

2 participants