Skip to content

Commit 8db4791

Browse files
Changed the allocation strategy for the nativ arrays for a massiv performance boost
1 parent bdf4799 commit 8db4791

File tree

2 files changed

+63
-62
lines changed

2 files changed

+63
-62
lines changed

Frontend/VIAProMa/Assets/Scripts/Connection Curves/ConnectionCurveManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Photon.Pun.UtilityScripts;
88
using System.Threading.Tasks;
99
using HoloToolkit.Unity;
10+
using Unity.Collections;
1011

1112
/// <summary>
1213
/// Manages the connect and disconnect process of Connection Curves and provides functions to manage curves.

Frontend/VIAProMa/Assets/Scripts/Connection Curves/SimpleCurveGeneration.cs

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,68 +1006,68 @@ public Vector3[] ReadResult(int index)
10061006

10071007
public void InitialiseArrays(int length)
10081008
{
1009-
curvePoint0 = new NativeArray<Vector3>(length, Allocator.TempJob);
1010-
curvePoint1 = new NativeArray<Vector3>(length, Allocator.TempJob);
1011-
curvePoint2 = new NativeArray<Vector3>(length, Allocator.TempJob);
1012-
curvePoint3 = new NativeArray<Vector3>(length, Allocator.TempJob);
1013-
curvePoint4 = new NativeArray<Vector3>(length, Allocator.TempJob);
1014-
curvePoint5 = new NativeArray<Vector3>(length, Allocator.TempJob);
1015-
curvePoint6 = new NativeArray<Vector3>(length, Allocator.TempJob);
1016-
curvePoint7 = new NativeArray<Vector3>(length, Allocator.TempJob);
1017-
curvePoint8 = new NativeArray<Vector3>(length, Allocator.TempJob);
1018-
curvePoint9 = new NativeArray<Vector3>(length, Allocator.TempJob);
1019-
curvePoint10 = new NativeArray<Vector3>(length, Allocator.TempJob);
1020-
curvePoint11 = new NativeArray<Vector3>(length, Allocator.TempJob);
1021-
curvePoint12 = new NativeArray<Vector3>(length, Allocator.TempJob);
1022-
curvePoint13 = new NativeArray<Vector3>(length, Allocator.TempJob);
1023-
curvePoint14 = new NativeArray<Vector3>(length, Allocator.TempJob);
1024-
curvePoint15 = new NativeArray<Vector3>(length, Allocator.TempJob);
1025-
curvePoint16 = new NativeArray<Vector3>(length, Allocator.TempJob);
1026-
curvePoint17 = new NativeArray<Vector3>(length, Allocator.TempJob);
1027-
curvePoint18 = new NativeArray<Vector3>(length, Allocator.TempJob);
1028-
curvePoint19 = new NativeArray<Vector3>(length, Allocator.TempJob);
1029-
curvePoint20 = new NativeArray<Vector3>(length, Allocator.TempJob);
1030-
curvePoint21 = new NativeArray<Vector3>(length, Allocator.TempJob);
1031-
curvePoint22 = new NativeArray<Vector3>(length, Allocator.TempJob);
1032-
curvePoint23 = new NativeArray<Vector3>(length, Allocator.TempJob);
1033-
curvePoint24 = new NativeArray<Vector3>(length, Allocator.TempJob);
1034-
curvePoint25 = new NativeArray<Vector3>(length, Allocator.TempJob);
1035-
curvePoint26 = new NativeArray<Vector3>(length, Allocator.TempJob);
1036-
curvePoint27 = new NativeArray<Vector3>(length, Allocator.TempJob);
1037-
curvePoint28 = new NativeArray<Vector3>(length, Allocator.TempJob);
1038-
curvePoint29 = new NativeArray<Vector3>(length, Allocator.TempJob);
1039-
curvePoint30 = new NativeArray<Vector3>(length, Allocator.TempJob);
1040-
curvePoint31 = new NativeArray<Vector3>(length, Allocator.TempJob);
1041-
curvePoint32 = new NativeArray<Vector3>(length, Allocator.TempJob);
1042-
curvePoint33 = new NativeArray<Vector3>(length, Allocator.TempJob);
1043-
curvePoint34 = new NativeArray<Vector3>(length, Allocator.TempJob);
1044-
curvePoint35 = new NativeArray<Vector3>(length, Allocator.TempJob);
1045-
curvePoint36 = new NativeArray<Vector3>(length, Allocator.TempJob);
1046-
curvePoint37 = new NativeArray<Vector3>(length, Allocator.TempJob);
1047-
curvePoint38 = new NativeArray<Vector3>(length, Allocator.TempJob);
1048-
curvePoint39 = new NativeArray<Vector3>(length, Allocator.TempJob);
1049-
curvePoint40 = new NativeArray<Vector3>(length, Allocator.TempJob);
1050-
curvePoint41 = new NativeArray<Vector3>(length, Allocator.TempJob);
1051-
curvePoint42 = new NativeArray<Vector3>(length, Allocator.TempJob);
1052-
curvePoint43 = new NativeArray<Vector3>(length, Allocator.TempJob);
1053-
curvePoint44 = new NativeArray<Vector3>(length, Allocator.TempJob);
1054-
curvePoint45 = new NativeArray<Vector3>(length, Allocator.TempJob);
1055-
curvePoint46 = new NativeArray<Vector3>(length, Allocator.TempJob);
1056-
curvePoint47 = new NativeArray<Vector3>(length, Allocator.TempJob);
1057-
curvePoint48 = new NativeArray<Vector3>(length, Allocator.TempJob);
1058-
curvePoint49 = new NativeArray<Vector3>(length, Allocator.TempJob);
1059-
curvePoint50 = new NativeArray<Vector3>(length, Allocator.TempJob);
1060-
curvePoint51 = new NativeArray<Vector3>(length, Allocator.TempJob);
1061-
curvePoint52 = new NativeArray<Vector3>(length, Allocator.TempJob);
1062-
curvePoint53 = new NativeArray<Vector3>(length, Allocator.TempJob);
1063-
curvePoint54 = new NativeArray<Vector3>(length, Allocator.TempJob);
1064-
curvePoint55 = new NativeArray<Vector3>(length, Allocator.TempJob);
1065-
curvePoint56 = new NativeArray<Vector3>(length, Allocator.TempJob);
1066-
curvePoint57 = new NativeArray<Vector3>(length, Allocator.TempJob);
1067-
curvePoint58 = new NativeArray<Vector3>(length, Allocator.TempJob);
1068-
curvePoint59 = new NativeArray<Vector3>(length, Allocator.TempJob);
1069-
1070-
isValid = new NativeArray<byte>(length, Allocator.TempJob);
1009+
curvePoint0 = new NativeArray<Vector3>(length, Allocator.Temp);
1010+
curvePoint1 = new NativeArray<Vector3>(length, Allocator.Temp);
1011+
curvePoint2 = new NativeArray<Vector3>(length, Allocator.Temp);
1012+
curvePoint3 = new NativeArray<Vector3>(length, Allocator.Temp);
1013+
curvePoint4 = new NativeArray<Vector3>(length, Allocator.Temp);
1014+
curvePoint5 = new NativeArray<Vector3>(length, Allocator.Temp);
1015+
curvePoint6 = new NativeArray<Vector3>(length, Allocator.Temp);
1016+
curvePoint7 = new NativeArray<Vector3>(length, Allocator.Temp);
1017+
curvePoint8 = new NativeArray<Vector3>(length, Allocator.Temp);
1018+
curvePoint9 = new NativeArray<Vector3>(length, Allocator.Temp);
1019+
curvePoint10 = new NativeArray<Vector3>(length, Allocator.Temp);
1020+
curvePoint11 = new NativeArray<Vector3>(length, Allocator.Temp);
1021+
curvePoint12 = new NativeArray<Vector3>(length, Allocator.Temp);
1022+
curvePoint13 = new NativeArray<Vector3>(length, Allocator.Temp);
1023+
curvePoint14 = new NativeArray<Vector3>(length, Allocator.Temp);
1024+
curvePoint15 = new NativeArray<Vector3>(length, Allocator.Temp);
1025+
curvePoint16 = new NativeArray<Vector3>(length, Allocator.Temp);
1026+
curvePoint17 = new NativeArray<Vector3>(length, Allocator.Temp);
1027+
curvePoint18 = new NativeArray<Vector3>(length, Allocator.Temp);
1028+
curvePoint19 = new NativeArray<Vector3>(length, Allocator.Temp);
1029+
curvePoint20 = new NativeArray<Vector3>(length, Allocator.Temp);
1030+
curvePoint21 = new NativeArray<Vector3>(length, Allocator.Temp);
1031+
curvePoint22 = new NativeArray<Vector3>(length, Allocator.Temp);
1032+
curvePoint23 = new NativeArray<Vector3>(length, Allocator.Temp);
1033+
curvePoint24 = new NativeArray<Vector3>(length, Allocator.Temp);
1034+
curvePoint25 = new NativeArray<Vector3>(length, Allocator.Temp);
1035+
curvePoint26 = new NativeArray<Vector3>(length, Allocator.Temp);
1036+
curvePoint27 = new NativeArray<Vector3>(length, Allocator.Temp);
1037+
curvePoint28 = new NativeArray<Vector3>(length, Allocator.Temp);
1038+
curvePoint29 = new NativeArray<Vector3>(length, Allocator.Temp);
1039+
curvePoint30 = new NativeArray<Vector3>(length, Allocator.Temp);
1040+
curvePoint31 = new NativeArray<Vector3>(length, Allocator.Temp);
1041+
curvePoint32 = new NativeArray<Vector3>(length, Allocator.Temp);
1042+
curvePoint33 = new NativeArray<Vector3>(length, Allocator.Temp);
1043+
curvePoint34 = new NativeArray<Vector3>(length, Allocator.Temp);
1044+
curvePoint35 = new NativeArray<Vector3>(length, Allocator.Temp);
1045+
curvePoint36 = new NativeArray<Vector3>(length, Allocator.Temp);
1046+
curvePoint37 = new NativeArray<Vector3>(length, Allocator.Temp);
1047+
curvePoint38 = new NativeArray<Vector3>(length, Allocator.Temp);
1048+
curvePoint39 = new NativeArray<Vector3>(length, Allocator.Temp);
1049+
curvePoint40 = new NativeArray<Vector3>(length, Allocator.Temp);
1050+
curvePoint41 = new NativeArray<Vector3>(length, Allocator.Temp);
1051+
curvePoint42 = new NativeArray<Vector3>(length, Allocator.Temp);
1052+
curvePoint43 = new NativeArray<Vector3>(length, Allocator.Temp);
1053+
curvePoint44 = new NativeArray<Vector3>(length, Allocator.Temp);
1054+
curvePoint45 = new NativeArray<Vector3>(length, Allocator.Temp);
1055+
curvePoint46 = new NativeArray<Vector3>(length, Allocator.Temp);
1056+
curvePoint47 = new NativeArray<Vector3>(length, Allocator.Temp);
1057+
curvePoint48 = new NativeArray<Vector3>(length, Allocator.Temp);
1058+
curvePoint49 = new NativeArray<Vector3>(length, Allocator.Temp);
1059+
curvePoint50 = new NativeArray<Vector3>(length, Allocator.Temp);
1060+
curvePoint51 = new NativeArray<Vector3>(length, Allocator.Temp);
1061+
curvePoint52 = new NativeArray<Vector3>(length, Allocator.Temp);
1062+
curvePoint53 = new NativeArray<Vector3>(length, Allocator.Temp);
1063+
curvePoint54 = new NativeArray<Vector3>(length, Allocator.Temp);
1064+
curvePoint55 = new NativeArray<Vector3>(length, Allocator.Temp);
1065+
curvePoint56 = new NativeArray<Vector3>(length, Allocator.Temp);
1066+
curvePoint57 = new NativeArray<Vector3>(length, Allocator.Temp);
1067+
curvePoint58 = new NativeArray<Vector3>(length, Allocator.Temp);
1068+
curvePoint59 = new NativeArray<Vector3>(length, Allocator.Temp);
1069+
1070+
isValid = new NativeArray<byte>(length, Allocator.Temp);
10711071
}
10721072

10731073
public void DisposeArrays()

0 commit comments

Comments
 (0)