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

Benchmark react-native-encryptify #30523

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
0d857d6
chore: add path-browserify
chrispader Sep 20, 2023
cb9d2f9
chore: add path polyfill to webpack
chrispader Sep 20, 2023
67d7cc4
feat: test encryption wasm file
chrispader Sep 20, 2023
cf43cb7
Merge branch 'main' into @chrispader/test-encryptify
chrispader Sep 20, 2023
c909f9d
Merge branch 'main' into @chrispader/test-encryptify
chrispader Sep 21, 2023
9c23a4f
fix: remove polyfills
chrispader Sep 21, 2023
e416a29
Merge branch 'main' into @chrispader/test-encryptify
chrispader Sep 22, 2023
86743c0
fix: update webpack
chrispader Sep 22, 2023
0393049
chore: update dependencies
chrispader Sep 22, 2023
488f6d9
fix: import
chrispader Sep 22, 2023
63a9cd5
fix: webpack config
chrispader Sep 23, 2023
9b0b99e
fix: add useEncryptify hook
chrispader Sep 23, 2023
1b6048f
log
chrispader Sep 25, 2023
e599a63
Merge branch 'main' into @chrispader/test-encryptify
chrispader Oct 2, 2023
61721c1
Merge branch 'main' into @chrispader/test-encryptify
chrispader Oct 9, 2023
7b9b032
Merge branch 'main' into @chrispader/test-encryptify
chrispader Oct 10, 2023
6ac7c66
Merge branch 'main' into @chrispader/test-encryptify
chrispader Oct 12, 2023
e4fd166
Merge branch 'main' into @chrispader/test-encryptify
chrispader Oct 16, 2023
5bdd1e2
Merge branch 'main' into @chrispader/test-encryptify
chrispader Oct 16, 2023
d7f62cd
Merge branch 'main' into @chrispader/test-encryptify
chrispader Oct 22, 2023
c2826a3
update example
chrispader Oct 22, 2023
69d18cb
fix: remove unused dependency
chrispader Oct 22, 2023
4370e28
chore: reset package-lock.json
chrispader Oct 22, 2023
e1fc68c
reset package.json
chrispader Oct 22, 2023
7ae5968
Merge branch 'main' into @chrispader/test-encryptify
chrispader Oct 25, 2023
bfa85ae
fix: update initialization
chrispader Oct 25, 2023
94fc3fc
update example
chrispader Oct 25, 2023
ef24c65
fix: wrong name
chrispader Oct 25, 2023
39ba292
restructure setup logic
chrispader Oct 25, 2023
209a83c
add log
chrispader Oct 25, 2023
7e05e4e
add missing return
chrispader Oct 25, 2023
7d1c513
clean up example
chrispader Oct 25, 2023
7d46f2c
Merge branch 'main' into @chrispader/test-encryptify
chrispader Oct 27, 2023
0c3df42
update example to add performance tests
chrispader Oct 27, 2023
c0624d3
add more performance metrics
chrispader Oct 27, 2023
d86b2d1
fix: extract performance test code
chrispader Oct 27, 2023
7440e51
fix: improve performance test
chrispader Oct 27, 2023
04d1b04
update tests
chrispader Oct 27, 2023
f616e59
fix: typo
chrispader Oct 27, 2023
2d9cd01
add more tests
chrispader Oct 27, 2023
68d79d9
add wasm load time metric
chrispader Oct 27, 2023
77594c8
update app startup test
chrispader Oct 27, 2023
d2b1996
export constant
chrispader Oct 27, 2023
4ba1c5c
update example to use async functions
chrispader Oct 28, 2023
6da1737
Merge branch 'main' into @chrispader/test-encryptify
chrispader Nov 2, 2023
e5c9bb3
fix: import order
chrispader Nov 2, 2023
3878021
Merge branch '@chrispader/test-encryptify' into @chrispader/test-encr…
chrispader Nov 2, 2023
8441a0b
fix: merge changes
chrispader Nov 2, 2023
01c4756
Merge branch 'main' into @chrispader/test-encryptify-performance
chrispader Nov 3, 2023
d0df084
fix: desktop setup
chrispader Nov 3, 2023
411c26e
update encryption function names
chrispader Nov 3, 2023
14240b8
make file import consistent
chrispader Nov 3, 2023
915e10c
add Xcode 15 podfile workaround
chrispader Nov 3, 2023
12b632f
fix: pods workaround
chrispader Nov 3, 2023
72d54fd
fix: update test
chrispader Nov 3, 2023
a0f5a13
remove comment
chrispader Nov 3, 2023
51162a5
update Podfile.lock
chrispader Nov 3, 2023
570d3c1
Merge branch 'main' into @chrispader/test-encryptify-performance
chrispader Nov 6, 2023
3306392
fix: reduce wait time
chrispader Nov 7, 2023
f257d20
fix: measurement names
chrispader Nov 7, 2023
b9bfaa5
chore: add .yalc to eslint ignore patterns
chrispader Nov 7, 2023
2dce1e1
Merge branch 'main' into @chrispader/test-encryptify-performance
chrispader Nov 7, 2023
42d4722
Merge branch 'main' into @chrispader/test-encryptify
chrispader Nov 15, 2023
4d8b1d3
Merge branch '@chrispader/test-encryptify' into @chrispader/test-encr…
chrispader Nov 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-hooks/recommended', 'plugin:react-native-a11y/basic', 'plugin:@dword-design/import-alias/recommended', 'prettier'],
plugins: ['react-hooks', 'react-native-a11y'],
parser: 'babel-eslint',
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', 'node_modules/.cache/**', '.git/**'],
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', 'node_modules/.cache/**', '.git/**', '.yalc/**'],
env: {
jest: true,
},
Expand Down
4 changes: 4 additions & 0 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({
resourceQuery: /raw/,
type: 'asset/source',
},
{
test: /\.wasm$/i,
type: 'asset/resource',
},
{
test: /\.lottie$/,
type: 'asset/resource',
Expand Down
19 changes: 16 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@
*/
import {AppRegistry} from 'react-native';
import {enableLegacyWebImplementation} from 'react-native-gesture-handler';
import performance from 'react-native-performance';
import App from './src/App';
import Config from './src/CONFIG';
import additionalAppSetup from './src/setup';
import * as Setup from './src/setup';
import * as EncrpytifyPerformanceTest from './src/testEncryptifyPerformance';

performance.mark('appStartup');

enableLegacyWebImplementation(true);
AppRegistry.registerComponent(Config.APP_NAME, () => App);
additionalAppSetup();

Setup.beforeAppLoad().then(() => {
performance.measure('Encryptify WASM load', 'appStartup');
const wasmLoadTime = performance.getEntriesByName('Encryptify WASM load')[0].duration;
// eslint-disable-next-line no-console
console.log(`Encryptify WASM load time: ${wasmLoadTime.toFixed(EncrpytifyPerformanceTest.PERFORMANCE_METRICS_DECIMAL_PLACES)}ms`);

AppRegistry.registerComponent(Config.APP_NAME, () => App);
Setup.afterAppLoad();
});
Setup.additional();
9 changes: 9 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ def __apply_Xcode_14_3_RC_post_install_workaround(installer)
end
end

def __apply_Xcode_15_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
end
end
end

# Configure Mapbox before installing dependencies
pre_install do |installer|
$RNMapboxMaps.pre_install(installer)
Expand Down Expand Up @@ -108,6 +116,7 @@ target 'NewExpensify' do
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
__apply_Xcode_14_3_RC_post_install_workaround(installer)
__apply_Xcode_15_post_install_workaround(installer)

installer.pods_project.targets.each do |target|
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
Expand Down
83 changes: 56 additions & 27 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -188,33 +188,33 @@ PODS:
- GoogleUtilities/Network (~> 7.4)
- "GoogleUtilities/NSData+zlib (~> 7.4)"
- nanopb (~> 2.30908.0)
- GoogleDataTransport (9.2.3):
- GoogleDataTransport (9.2.5):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleSignIn (7.0.0):
- AppAuth (~> 1.5)
- GTMAppAuth (< 3.0, >= 1.3)
- GTMSessionFetcher/Core (< 4.0, >= 1.1)
- GoogleUtilities/AppDelegateSwizzler (7.11.1):
- GoogleUtilities/AppDelegateSwizzler (7.11.5):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.11.1):
- GoogleUtilities/Environment (7.11.5):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/ISASwizzler (7.11.1)
- GoogleUtilities/Logger (7.11.1):
- GoogleUtilities/ISASwizzler (7.11.5)
- GoogleUtilities/Logger (7.11.5):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (7.11.1):
- GoogleUtilities/MethodSwizzler (7.11.5):
- GoogleUtilities/Logger
- GoogleUtilities/Network (7.11.1):
- GoogleUtilities/Network (7.11.5):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.11.1)"
- GoogleUtilities/Reachability (7.11.1):
- "GoogleUtilities/NSData+zlib (7.11.5)"
- GoogleUtilities/Reachability (7.11.5):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (7.11.1):
- GoogleUtilities/UserDefaults (7.11.5):
- GoogleUtilities/Logger
- GTMAppAuth (2.0.0):
- AppAuth/Core (~> 1.6)
Expand All @@ -224,15 +224,18 @@ PODS:
- hermes-engine/Pre-built (= 0.72.4)
- hermes-engine/Pre-built (0.72.4)
- libevent (2.1.12)
- libwebp (1.2.4):
- libwebp/demux (= 1.2.4)
- libwebp/mux (= 1.2.4)
- libwebp/webp (= 1.2.4)
- libwebp/demux (1.2.4):
- libwebp (1.3.2):
- libwebp/demux (= 1.3.2)
- libwebp/mux (= 1.3.2)
- libwebp/sharpyuv (= 1.3.2)
- libwebp/webp (= 1.3.2)
- libwebp/demux (1.3.2):
- libwebp/webp
- libwebp/mux (1.2.4):
- libwebp/mux (1.3.2):
- libwebp/demux
- libwebp/webp (1.2.4)
- libwebp/sharpyuv (1.3.2)
- libwebp/webp (1.3.2):
- libwebp/sharpyuv
- lottie-ios (4.3.3)
- lottie-react-native (6.4.0):
- lottie-ios (~> 4.3.3)
Expand All @@ -251,13 +254,13 @@ PODS:
- nanopb/encode (= 2.30908.0)
- nanopb/decode (2.30908.0)
- nanopb/encode (2.30908.0)
- Onfido (28.3.0)
- Onfido (28.3.1)
- onfido-react-native-sdk (8.3.0):
- Onfido (~> 28.3.0)
- React
- OpenSSL-Universal (1.1.1100)
- Plaid (4.1.0)
- PromisesObjC (2.2.0)
- PromisesObjC (2.3.1)
- RCT-Folly (2021.07.22.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -571,6 +574,13 @@ PODS:
- React-Core
- react-native-document-picker (8.1.1):
- React-Core
- react-native-encryptify (0.1.0):
- OpenSSL-Universal
- RCT-Folly (= 2021.07.22.00)
- React
- React-callinvoker
- React-Core
- ReactCommon
- react-native-flipper (0.159.0):
- React-Core
- react-native-geolocation (3.0.6):
Expand Down Expand Up @@ -698,6 +708,21 @@ PODS:
- glog
- RCT-Folly (= 2021.07.22.00)
- React-debug
- ReactCommon (0.72.4):
- React-logger (= 0.72.4)
- ReactCommon/turbomodule (= 0.72.4)
- ReactCommon/turbomodule (0.72.4):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.72.4)
- React-cxxreact (= 0.72.4)
- React-jsi (= 0.72.4)
- React-logger (= 0.72.4)
- React-perflogger (= 0.72.4)
- ReactCommon/turbomodule/bridging (= 0.72.4)
- ReactCommon/turbomodule/core (= 0.72.4)
- ReactCommon/turbomodule/bridging (0.72.4):
- DoubleConversion
- glog
Expand Down Expand Up @@ -820,7 +845,7 @@ PODS:
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.10)
- SocketRocket (0.6.1)
- Turf (2.6.1)
- Turf (2.7.0)
- VisionCamera (2.16.2):
- React
- React-callinvoker
Expand Down Expand Up @@ -883,6 +908,7 @@ DEPENDENCIES:
- "react-native-cameraroll (from `../node_modules/@react-native-camera-roll/camera-roll`)"
- react-native-config (from `../node_modules/react-native-config`)
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- react-native-encryptify (from `../node_modules/react-native-encryptify`)
- react-native-flipper (from `../node_modules/react-native-flipper`)
- "react-native-geolocation (from `../node_modules/@react-native-community/geolocation`)"
- "react-native-image-manipulator (from `../node_modules/@oguzhnatly/react-native-image-manipulator`)"
Expand Down Expand Up @@ -1049,6 +1075,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-config"
react-native-document-picker:
:path: "../node_modules/react-native-document-picker"
react-native-encryptify:
:path: "../node_modules/react-native-encryptify"
react-native-flipper:
:path: "../node_modules/react-native-flipper"
react-native-geolocation:
Expand Down Expand Up @@ -1194,26 +1222,26 @@ SPEC CHECKSUMS:
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
GoogleAppMeasurement: 5ba1164e3c844ba84272555e916d0a6d3d977e91
GoogleDataTransport: f0308f5905a745f94fb91fea9c6cbaf3831cb1bd
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
GoogleSignIn: b232380cf495a429b8095d3178a8d5855b42e842
GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084
GTMAppAuth: 99fb010047ba3973b7026e45393f51f27ab965ae
GTMSessionFetcher: e8647203b65cee28c5f73d0f473d096653945e72
hermes-engine: 81191603c4eaa01f5e4ae5737a9efcf64756c7b2
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
lottie-ios: 25e7b2675dad5c3ddad369ac9baab03560c5bfdd
lottie-react-native: 3a3084faddd3891c276f23fd6e797b83f2021bbc
MapboxCommon: 4a0251dd470ee37e7fadda8e285c01921a5e1eb0
MapboxCoreMaps: eb07203bbb0b1509395db5ab89cd3ad6c2e3c04c
MapboxMaps: af50ec61a7eb3b032c3f7962c6bd671d93d2a209
MapboxMobileEvents: de50b3a4de180dd129c326e09cd12c8adaaa46d6
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
Onfido: c7d010d9793790d44a07799d9be25aa8e3814ee7
Onfido: 564f60c39819635ec5b549285a1eec278cc9ba67
onfido-react-native-sdk: b346a620af5669f9fecb6dc3052314a35a94ad9f
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
Plaid: 7d340abeadb46c7aa1a91f896c5b22395a31fcf2
PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: c0569ecc035894e4a68baecb30fe6a7ea6e399f9
RCTTypeSafety: e90354072c21236e0bcf1699011e39acd25fea2f
Expand All @@ -1234,6 +1262,7 @@ SPEC CHECKSUMS:
react-native-cameraroll: 8ffb0af7a5e5de225fd667610e2979fc1f0c2151
react-native-config: 7cd105e71d903104e8919261480858940a6b9c0e
react-native-document-picker: f68191637788994baed5f57d12994aa32cf8bf88
react-native-encryptify: 9b51d26f7c6ae93e435e88f2d77b82e4067a4e78
react-native-flipper: dc5290261fbeeb2faec1bdc57ae6dd8d562e1de4
react-native-geolocation: 0f7fe8a4c2de477e278b0365cce27d089a8c5903
react-native-image-manipulator: c48f64221cfcd46e9eec53619c4c0374f3328a56
Expand Down Expand Up @@ -1292,11 +1321,11 @@ SPEC CHECKSUMS:
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Turf: 469ce2c3d22e5e8e4818d5a3b254699a5c89efa4
Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2
VisionCamera: 95f969b8950b411285579d633a1014782fe0e634
Yoga: 3efc43e0d48686ce2e8c60f99d4e6bd349aff981
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: ff769666b7221c15936ebc5576a8c8e467dc6879
PODFILE CHECKSUM: f2ea68e941617414216a8bca1a97139018d2ae5d

COCOAPODS: 1.12.1
77 changes: 77 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"react-native-device-info": "^10.3.0",
"react-native-document-picker": "^8.0.0",
"react-native-draggable-flatlist": "^4.0.1",
"react-native-encryptify": "file:../react-native-encryptify",
"react-native-fast-image": "^8.6.3",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "2.12.0",
Expand Down
Loading
Loading