You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+217
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ This document covers following sections:
13
13
-[Configuration](#configuration)
14
14
-[Development](#development)
15
15
-[Glossary](#glossary)
16
+
-[Performance](#performance)
16
17
17
18
## <aname='usage'></a>Usage
18
19
@@ -858,3 +859,219 @@ Use the script called `dev.sh` to manage the image. Here are the available comma
858
859
| (API) Model | Domain representation for specific API. Data-transfer object, POPO that contains only values of attributes and identifiers of related resources. |
859
860
| (JSON:API) Resource | Object representation of JSON:API resource defined by the JSON:API specification. |
860
861
862
+
## <a name='performance'></a>Performance
863
+
864
+
Performance is an important part of every backend application. We tested returning a list of resources on the 1 vCPU (1797.917 MHz) server with 1 GB of RAM. The installed PHP version was 8.0.3 and Symfony packages were 6.0.*. xDebug was disabled.
865
+
866
+
The tested request was a list of 10 resources with included relationships.
867
+
868
+
Example:
869
+
870
+
```
871
+
{
872
+
"jsonapi": {
873
+
"version": "1.0"
874
+
},
875
+
"meta": {
876
+
"total": 501
877
+
},
878
+
"data": [
879
+
{
880
+
"type": "products",
881
+
"id": "01FR7ZF0CVC7DWYAXK9NN75B2E",
882
+
"attributes": {
883
+
"name": "khlywk oingpndl",
884
+
"price": 34575
885
+
},
886
+
"relationships": {
887
+
"productVariants": {
888
+
"data": [
889
+
{
890
+
"type": "product-variants",
891
+
"id": "01GPBFYZCGF6Y6S99J4YG403K8"
892
+
},
893
+
{
894
+
"type": "product-variants",
895
+
"id": "01GPBFYZCGF6Y6S99J4YG403K9"
896
+
},
897
+
{
898
+
"type": "product-variants",
899
+
"id": "01GPBFYZCGF6Y6S99J4YG403KA"
900
+
},
901
+
{
902
+
"type": "product-variants",
903
+
"id": "01GPBFYZCGF6Y6S99J4YG403KB"
904
+
},
905
+
{
906
+
"type": "product-variants",
907
+
"id": "01GPBFYZCGF6Y6S99J4YG403KC"
908
+
},
909
+
{
910
+
"type": "product-variants",
911
+
"id": "01GPBFYZCGF6Y6S99J4YG403KD"
912
+
},
913
+
{
914
+
"type": "product-variants",
915
+
"id": "01GPBFYZCGF6Y6S99J4YG403KE"
916
+
},
917
+
{
918
+
"type": "product-variants",
919
+
"id": "01GPBFYZCGF6Y6S99J4YG403KF"
920
+
},
921
+
{
922
+
"type": "product-variants",
923
+
"id": "01GPBFYZCGF6Y6S99J4YG403KG"
924
+
},
925
+
{
926
+
"type": "product-variants",
927
+
"id": "01GPBFYZCGF6Y6S99J4YG403KH"
928
+
},
929
+
{
930
+
"type": "product-variants",
931
+
"id": "01GPBFYZCGF6Y6S99J4YG403KJ"
932
+
},
933
+
{
934
+
"type": "product-variants",
935
+
"id": "01GPBFYZCGF6Y6S99J4YG403KK"
936
+
},
937
+
{
938
+
"type": "product-variants",
939
+
"id": "01GPBFYZCGF6Y6S99J4YG403KM"
940
+
},
941
+
{
942
+
"type": "product-variants",
943
+
"id": "01GPBFYZCGF6Y6S99J4YG403KN"
944
+
}
945
+
]
946
+
}
947
+
}
948
+
},
949
+
.....
950
+
"included": [
951
+
{
952
+
"type": "product-variants",
953
+
"id": "01GPBFYZCGF6Y6S99J4YG403K8",
954
+
"attributes": {
955
+
"color": "LightPink",
956
+
"size": "eum",
957
+
"multiplier": 0.8
958
+
},
959
+
"relationships": {
960
+
"product": {
961
+
"data": {
962
+
"type": "products",
963
+
"id": "01FR7ZF0CVC7DWYAXK9NN75B2E"
964
+
}
965
+
}
966
+
}
967
+
},
968
+
.....
969
+
```
970
+
971
+
The response was around 17.5 kb and the average response time was 158 ms.
972
+
973
+
The same response was tested without the library in a way that it was assembled inside the controller by looping through data and creating JSON:API compatible PHP array which was returned in JsonResponse.
974
+
975
+
The response was around 17.5 kb and the average response time was 140 ms.
976
+
977
+
The same resources were returned as plain response without any standardization.
978
+
979
+
Example:
980
+
981
+
```
982
+
[
983
+
{
984
+
"id": "01FR7ZF0CVC7DWYAXK9NN75B2E",
985
+
"name": "khlywk oingpndl",
986
+
"price": 34575,
987
+
"variants": [
988
+
{
989
+
"id": "01GPBFYZCGF6Y6S99J4YG403K8",
990
+
"color": "LightPink",
991
+
"size": "eum",
992
+
"multiplier": 0.8
993
+
},
994
+
{
995
+
"id": "01GPBFYZCGF6Y6S99J4YG403K9",
996
+
"color": "WhiteSmoke",
997
+
"size": "ut",
998
+
"multiplier": 0.4
999
+
},
1000
+
{
1001
+
"id": "01GPBFYZCGF6Y6S99J4YG403KA",
1002
+
"color": "Aqua",
1003
+
"size": "quibusdam",
1004
+
"multiplier": 1
1005
+
},
1006
+
{
1007
+
"id": "01GPBFYZCGF6Y6S99J4YG403KB",
1008
+
"color": "SandyBrown",
1009
+
"size": "minima",
1010
+
"multiplier": 2.1
1011
+
},
1012
+
{
1013
+
"id": "01GPBFYZCGF6Y6S99J4YG403KC",
1014
+
"color": "GreenYellow",
1015
+
"size": "ipsa",
1016
+
"multiplier": 1.3
1017
+
},
1018
+
{
1019
+
"id": "01GPBFYZCGF6Y6S99J4YG403KD",
1020
+
"color": "PeachPuff",
1021
+
"size": "sit",
1022
+
"multiplier": 0.3
1023
+
},
1024
+
{
1025
+
"id": "01GPBFYZCGF6Y6S99J4YG403KE",
1026
+
"color": "LavenderBlush",
1027
+
"size": "aut",
1028
+
"multiplier": 0.3
1029
+
},
1030
+
{
1031
+
"id": "01GPBFYZCGF6Y6S99J4YG403KF",
1032
+
"color": "LawnGreen",
1033
+
"size": "dolor",
1034
+
"multiplier": 1.3
1035
+
},
1036
+
{
1037
+
"id": "01GPBFYZCGF6Y6S99J4YG403KG",
1038
+
"color": "MediumBlue",
1039
+
"size": "eos",
1040
+
"multiplier": 0.1
1041
+
},
1042
+
{
1043
+
"id": "01GPBFYZCGF6Y6S99J4YG403KH",
1044
+
"color": "DarkSlateGray",
1045
+
"size": "esse",
1046
+
"multiplier": 1.5
1047
+
},
1048
+
{
1049
+
"id": "01GPBFYZCGF6Y6S99J4YG403KJ",
1050
+
"color": "Gray",
1051
+
"size": "consequatur",
1052
+
"multiplier": 2.9
1053
+
},
1054
+
{
1055
+
"id": "01GPBFYZCGF6Y6S99J4YG403KK",
1056
+
"color": "CadetBlue",
1057
+
"size": "fuga",
1058
+
"multiplier": 1.7
1059
+
},
1060
+
{
1061
+
"id": "01GPBFYZCGF6Y6S99J4YG403KM",
1062
+
"color": "Aqua",
1063
+
"size": "tenetur",
1064
+
"multiplier": 1.3
1065
+
},
1066
+
{
1067
+
"id": "01GPBFYZCGF6Y6S99J4YG403KN",
1068
+
"color": "FireBrick",
1069
+
"size": "esse",
1070
+
"multiplier": 1.3
1071
+
}
1072
+
]
1073
+
},
1074
+
.....
1075
+
```
1076
+
1077
+
The response was around 6 kb and the average response time was 103 ms.
0 commit comments