Skip to content

Commit 06510c0

Browse files
Upload Benchmark App
Co-authored-by: Mattia Ferrari <[email protected]>
1 parent efda07f commit 06510c0

27 files changed

+2318
-1165
lines changed

example/android/app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,4 @@ dependencies {
116116
}
117117

118118
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
119+
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")

example/babel.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ const pak = require('../package.json');
33

44
module.exports = {
55
presets: ['module:@react-native/babel-preset'],
6+
env: {
7+
production: {
8+
plugins: ['react-native-paper/babel'],
9+
},
10+
},
611
plugins: [
712
[
813
'module-resolver',

example/index.d.ts

-3
This file was deleted.

example/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import "react-native-get-random-values"
12
import { AppRegistry } from 'react-native';
23
import App from './src/App';
34
import { name as appName } from './app.json';
45

6+
57
AppRegistry.registerComponent(appName, () => App);

example/ios/GetRandomValuesExample/Info.plist

+22
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,27 @@
4848
</array>
4949
<key>UIViewControllerBasedStatusBarAppearance</key>
5050
<false/>
51+
<key>UIAppFonts</key>
52+
<array>
53+
<string>AntDesign.ttf</string>
54+
<string>Entypo.ttf</string>
55+
<string>EvilIcons.ttf</string>
56+
<string>Feather.ttf</string>
57+
<string>FontAwesome.ttf</string>
58+
<string>FontAwesome5_Brands.ttf</string>
59+
<string>FontAwesome5_Regular.ttf</string>
60+
<string>FontAwesome5_Solid.ttf</string>
61+
<string>FontAwesome6_Brands.ttf</string>
62+
<string>FontAwesome6_Regular.ttf</string>
63+
<string>FontAwesome6_Solid.ttf</string>
64+
<string>Foundation.ttf</string>
65+
<string>Ionicons.ttf</string>
66+
<string>MaterialIcons.ttf</string>
67+
<string>MaterialCommunityIcons.ttf</string>
68+
<string>SimpleLineIcons.ttf</string>
69+
<string>Octicons.ttf</string>
70+
<string>Zocial.ttf</string>
71+
<string>Fontisto.ttf</string>
72+
</array>
5173
</dict>
5274
</plist>

example/ios/Podfile.lock

+145-1
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,72 @@ PODS:
958958
- React-debug
959959
- react-native-get-random-values (1.11.0):
960960
- React-Core
961+
- react-native-safe-area-context (4.11.0):
962+
- DoubleConversion
963+
- glog
964+
- hermes-engine
965+
- RCT-Folly (= 2024.01.01.00)
966+
- RCTRequired
967+
- RCTTypeSafety
968+
- React-Codegen
969+
- React-Core
970+
- React-debug
971+
- React-Fabric
972+
- React-featureflags
973+
- React-graphics
974+
- React-ImageManager
975+
- react-native-safe-area-context/common (= 4.11.0)
976+
- react-native-safe-area-context/fabric (= 4.11.0)
977+
- React-NativeModulesApple
978+
- React-RCTFabric
979+
- React-rendererdebug
980+
- React-utils
981+
- ReactCommon/turbomodule/bridging
982+
- ReactCommon/turbomodule/core
983+
- Yoga
984+
- react-native-safe-area-context/common (4.11.0):
985+
- DoubleConversion
986+
- glog
987+
- hermes-engine
988+
- RCT-Folly (= 2024.01.01.00)
989+
- RCTRequired
990+
- RCTTypeSafety
991+
- React-Codegen
992+
- React-Core
993+
- React-debug
994+
- React-Fabric
995+
- React-featureflags
996+
- React-graphics
997+
- React-ImageManager
998+
- React-NativeModulesApple
999+
- React-RCTFabric
1000+
- React-rendererdebug
1001+
- React-utils
1002+
- ReactCommon/turbomodule/bridging
1003+
- ReactCommon/turbomodule/core
1004+
- Yoga
1005+
- react-native-safe-area-context/fabric (4.11.0):
1006+
- DoubleConversion
1007+
- glog
1008+
- hermes-engine
1009+
- RCT-Folly (= 2024.01.01.00)
1010+
- RCTRequired
1011+
- RCTTypeSafety
1012+
- React-Codegen
1013+
- React-Core
1014+
- React-debug
1015+
- React-Fabric
1016+
- React-featureflags
1017+
- React-graphics
1018+
- React-ImageManager
1019+
- react-native-safe-area-context/common
1020+
- React-NativeModulesApple
1021+
- React-RCTFabric
1022+
- React-rendererdebug
1023+
- React-utils
1024+
- ReactCommon/turbomodule/bridging
1025+
- ReactCommon/turbomodule/core
1026+
- Yoga
9611027
- React-nativeconfig (0.74.2)
9621028
- React-NativeModulesApple (0.74.2):
9631029
- glog
@@ -1187,6 +1253,51 @@ PODS:
11871253
- React-logger (= 0.74.2)
11881254
- React-perflogger (= 0.74.2)
11891255
- React-utils (= 0.74.2)
1256+
- RNScreens (3.32.0):
1257+
- DoubleConversion
1258+
- glog
1259+
- hermes-engine
1260+
- RCT-Folly (= 2024.01.01.00)
1261+
- RCTRequired
1262+
- RCTTypeSafety
1263+
- React-Codegen
1264+
- React-Core
1265+
- React-debug
1266+
- React-Fabric
1267+
- React-featureflags
1268+
- React-graphics
1269+
- React-ImageManager
1270+
- React-NativeModulesApple
1271+
- React-RCTFabric
1272+
- React-RCTImage
1273+
- React-rendererdebug
1274+
- React-utils
1275+
- ReactCommon/turbomodule/bridging
1276+
- ReactCommon/turbomodule/core
1277+
- RNScreens/common (= 3.32.0)
1278+
- Yoga
1279+
- RNScreens/common (3.32.0):
1280+
- DoubleConversion
1281+
- glog
1282+
- hermes-engine
1283+
- RCT-Folly (= 2024.01.01.00)
1284+
- RCTRequired
1285+
- RCTTypeSafety
1286+
- React-Codegen
1287+
- React-Core
1288+
- React-debug
1289+
- React-Fabric
1290+
- React-featureflags
1291+
- React-graphics
1292+
- React-ImageManager
1293+
- React-NativeModulesApple
1294+
- React-RCTFabric
1295+
- React-RCTImage
1296+
- React-rendererdebug
1297+
- React-utils
1298+
- ReactCommon/turbomodule/bridging
1299+
- ReactCommon/turbomodule/core
1300+
- Yoga
11901301
- RNSodium (0.2.0):
11911302
- DoubleConversion
11921303
- glog
@@ -1209,6 +1320,27 @@ PODS:
12091320
- ReactCommon/turbomodule/bridging
12101321
- ReactCommon/turbomodule/core
12111322
- Yoga
1323+
- RNVectorIcons (10.2.0):
1324+
- DoubleConversion
1325+
- glog
1326+
- hermes-engine
1327+
- RCT-Folly (= 2024.01.01.00)
1328+
- RCTRequired
1329+
- RCTTypeSafety
1330+
- React-Codegen
1331+
- React-Core
1332+
- React-debug
1333+
- React-Fabric
1334+
- React-featureflags
1335+
- React-graphics
1336+
- React-ImageManager
1337+
- React-NativeModulesApple
1338+
- React-RCTFabric
1339+
- React-rendererdebug
1340+
- React-utils
1341+
- ReactCommon/turbomodule/bridging
1342+
- ReactCommon/turbomodule/core
1343+
- Yoga
12121344
- SocketRocket (0.7.0)
12131345
- Yoga (0.0.0)
12141346

@@ -1247,6 +1379,7 @@ DEPENDENCIES:
12471379
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
12481380
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
12491381
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
1382+
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
12501383
- React-nativeconfig (from `../node_modules/react-native/ReactCommon`)
12511384
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
12521385
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
@@ -1270,7 +1403,9 @@ DEPENDENCIES:
12701403
- React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
12711404
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
12721405
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
1406+
- RNScreens (from `../node_modules/react-native-screens`)
12731407
- RNSodium (from `../..`)
1408+
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
12741409
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
12751410

12761411
SPEC REPOS:
@@ -1343,6 +1478,8 @@ EXTERNAL SOURCES:
13431478
:path: "../node_modules/react-native/ReactCommon"
13441479
react-native-get-random-values:
13451480
:path: "../node_modules/react-native-get-random-values"
1481+
react-native-safe-area-context:
1482+
:path: "../node_modules/react-native-safe-area-context"
13461483
React-nativeconfig:
13471484
:path: "../node_modules/react-native/ReactCommon"
13481485
React-NativeModulesApple:
@@ -1389,8 +1526,12 @@ EXTERNAL SOURCES:
13891526
:path: "../node_modules/react-native/ReactCommon/react/utils"
13901527
ReactCommon:
13911528
:path: "../node_modules/react-native/ReactCommon"
1529+
RNScreens:
1530+
:path: "../node_modules/react-native-screens"
13921531
RNSodium:
13931532
:path: "../.."
1533+
RNVectorIcons:
1534+
:path: "../node_modules/react-native-vector-icons"
13941535
Yoga:
13951536
:path: "../node_modules/react-native/ReactCommon/yoga"
13961537

@@ -1427,6 +1568,7 @@ SPEC CHECKSUMS:
14271568
React-logger: 29fa3e048f5f67fe396bc08af7606426d9bd7b5d
14281569
React-Mapbuffer: bf56147c9775491e53122a94c423ac201417e326
14291570
react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06
1571+
react-native-safe-area-context: f0d592c427d75508f2a7cd7375f533cc9283cd8a
14301572
React-nativeconfig: 9f223cd321823afdecf59ed00861ab2d69ee0fc1
14311573
React-NativeModulesApple: ff7efaff7098639db5631236cfd91d60abff04c0
14321574
React-perflogger: 32ed45d9cee02cf6639acae34251590dccd30994
@@ -1450,9 +1592,11 @@ SPEC CHECKSUMS:
14501592
React-runtimescheduler: 56b642bf605ba5afa500d35790928fc1d51565ad
14511593
React-utils: 4476b7fcbbd95cfd002f3e778616155241d86e31
14521594
ReactCommon: ecad995f26e0d1e24061f60f4e5d74782f003f12
1595+
RNScreens: d3d50aa84db4541eee00fbb1f32151030f56c510
14531596
RNSodium: 381683159bdd22fc7bc65b6e4e6a8950cbb27bc1
1597+
RNVectorIcons: 46a635b764a63e9a4ffedae054bca3847e0c8934
14541598
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
1455-
Yoga: 2f71ecf38d934aecb366e686278102a51679c308
1599+
Yoga: ae3c32c514802d30f687a04a6a35b348506d411f
14561600

14571601
PODFILE CHECKSUM: 2b476e664f3e7c6b87013748402bfab7c78276e5
14581602

example/package.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,20 @@
1111
"build:ios": "cd ios && xcodebuild -workspace GetRandomValuesExample.xcworkspace -scheme GetRandomValuesExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO"
1212
},
1313
"dependencies": {
14+
"@react-navigation/material-bottom-tabs": "^6.2.29",
15+
"@react-navigation/native": "^6.1.18",
16+
"@react-navigation/native-stack": "^6.11.0",
17+
"@types/react-native-vector-icons": "^6.4.18",
18+
"bignumber.js": "^9.1.2",
19+
"immer": "^10.1.1",
1420
"react": "18.2.0",
1521
"react-native": "0.74.2",
16-
"react-native-nitro-modules": "^0.9.2"
22+
"react-native-nitro-modules": "^0.9.2",
23+
"react-native-paper": "^5.12.5",
24+
"react-native-safe-area-context": "^4.11.0",
25+
"react-native-screens": "3.32.0",
26+
"react-native-vector-icons": "^10.2.0",
27+
"zustand": "^5.0.0-rc.2"
1728
},
1829
"devDependencies": {
1930
"@babel/core": "^7.20.0",

example/src/App.tsx

+5-54
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,10 @@
1-
import * as React from 'react';
2-
3-
import { StyleSheet, View, Text } from 'react-native';
4-
import { getRandomValues } from '@korekoi/react-native-get-random-values';
5-
import { getRandomValues as b64GetRandomValues } from "react-native-get-random-values"
6-
7-
8-
export default function App() {
9-
React.useEffect(() => {
10-
console.log("====================LIBSODIUM + NITRO=======================")
11-
const loops = 10000
12-
let sum = 0
13-
for (let i = 0; i < loops; i++) {
14-
const start = performance.now()
15-
const a = new Uint32Array(16384)
16-
getRandomValues(a)
17-
18-
const end = performance.now()
19-
sum += end - start
20-
}
21-
console.log(`Average time for ${loops} loops: ${sum / loops}ms`)
22-
}, [])
23-
24-
React.useEffect(() => {
25-
console.log("====================SERIALIZATION WITH SWIFT AND JAVA=======================")
26-
const loops = 1000
27-
let sum = 0
28-
for (let i = 0; i < loops; i++) {
29-
const start = performance.now()
30-
const a = new Uint32Array(16384)
31-
b64GetRandomValues(a)
32-
33-
const end = performance.now()
34-
sum += end - start
35-
}
36-
console.log(`Average time for ${loops} loops: ${sum / loops}ms`)
37-
}, [])
1+
import React, { type FunctionComponent } from "react"
2+
import Router from "./routers/Router"
383

4+
const App: FunctionComponent = () => {
395
return (
40-
<View style={styles.container}>
41-
<Text>
42-
Hello World!
43-
</Text>
44-
</View>
6+
<Router />
457
);
468
}
479

48-
const styles = StyleSheet.create({
49-
container: {
50-
flex: 1,
51-
alignItems: 'center',
52-
justifyContent: 'center',
53-
},
54-
box: {
55-
width: 60,
56-
height: 60,
57-
marginVertical: 20,
58-
},
59-
});
10+
export default App;

0 commit comments

Comments
 (0)