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

feat:(encoder) implement encoding on Virtual Machine for supporting AArch64 #580

Merged
merged 17 commits into from
Feb 1, 2024

Conversation

AsterDY
Copy link
Collaborator

@AsterDY AsterDY commented Jan 29, 2024

Background

Implemnt encoder by Vitural Machine

Performance

  • X86
cpu: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
BenchmarkMarshalConcrete/CanadaGeometry_Std-16               636           1815520 ns/op         148.94 MB/s      278544 B/op          1 allocs/op
BenchmarkMarshalConcrete/CanadaGeometry_StdV2-16             651           1835641 ns/op         147.31 MB/s      278543 B/op          1 allocs/op
BenchmarkMarshalConcrete/CanadaGeometry_Sonic-16            1296            928766 ns/op         291.14 MB/s      278575 B/op          2 allocs/op
BenchmarkMarshalConcrete/CanadaGeometry_SonicStd-16         1160            978478 ns/op         276.35 MB/s      689299 B/op          3 allocs/op
BenchmarkMarshalConcrete/CanadaGeometry_GoJson-16            763           1563846 ns/op         172.91 MB/s      278544 B/op          1 allocs/op
BenchmarkMarshalConcrete/CanadaGeometry_JsonIter-16          729           1577839 ns/op         171.38 MB/s      278550 B/op          2 allocs/op
BenchmarkMarshalConcrete/CanadaGeometry_JsonIterStd-16       753           1572130 ns/op         172.00 MB/s      278550 B/op          2 allocs/op
BenchmarkMarshalConcrete/CitmCatalog_Std-16                  906           1303635 ns/op        1324.91 MB/s      563640 B/op        912 allocs/op
BenchmarkMarshalConcrete/CitmCatalog_StdV2-16                620           1671078 ns/op        1033.59 MB/s      510022 B/op        125 allocs/op
BenchmarkMarshalConcrete/CitmCatalog_Sonic-16                873           1349015 ns/op        1280.34 MB/s      508007 B/op          2 allocs/op
BenchmarkMarshalConcrete/CitmCatalog_SonicStd-16             820           1489545 ns/op        1159.55 MB/s     1264068 B/op          3 allocs/op
BenchmarkMarshalConcrete/CitmCatalog_GoJson-16              1687            633064 ns/op        2728.32 MB/s      521388 B/op          3 allocs/op
BenchmarkMarshalConcrete/CitmCatalog_JsonIter-16            1021           1223591 ns/op        1411.59 MB/s      509140 B/op         22 allocs/op
BenchmarkMarshalConcrete/CitmCatalog_JsonIterStd-16          954           1223356 ns/op        1411.86 MB/s      565379 B/op        362 allocs/op
BenchmarkMarshalConcrete/GolangSource_Std-16                 206           6051907 ns/op         320.64 MB/s     1941603 B/op          1 allocs/op
BenchmarkMarshalConcrete/GolangSource_StdV2-16               152          10314157 ns/op         188.14 MB/s     1941600 B/op          1 allocs/op
BenchmarkMarshalConcrete/GolangSource_Sonic-16               190           5719350 ns/op         339.28 MB/s     1948312 B/op          2 allocs/op
BenchmarkMarshalConcrete/GolangSource_SonicStd-16            201           6029462 ns/op         321.83 MB/s     4865987 B/op          3 allocs/op
BenchmarkMarshalConcrete/GolangSource_GoJson-16              274           4220118 ns/op         459.81 MB/s     1941602 B/op          1 allocs/op
BenchmarkMarshalConcrete/GolangSource_JsonIter-16            193           6156361 ns/op         315.20 MB/s     1941608 B/op          2 allocs/op
BenchmarkMarshalConcrete/GolangSource_JsonIterStd-16         198           6279102 ns/op         309.04 MB/s     1995093 B/op          2 allocs/op
BenchmarkMarshalConcrete/StringEscaped_Std-16              26664             43480 ns/op         967.39 MB/s       18433 B/op          1 allocs/op
BenchmarkMarshalConcrete/StringEscaped_StdV2-16            28561             41279 ns/op        1018.98 MB/s       18438 B/op          1 allocs/op
BenchmarkMarshalConcrete/StringEscaped_Sonic-16           171274              7561 ns/op        5563.35 MB/s       18532 B/op          2 allocs/op
BenchmarkMarshalConcrete/StringEscaped_SonicStd-16         58074             23259 ns/op        1808.42 MB/s       46014 B/op          3 allocs/op
BenchmarkMarshalConcrete/StringEscaped_GoJson-16           21642             47622 ns/op         883.25 MB/s       18433 B/op          1 allocs/op
BenchmarkMarshalConcrete/StringEscaped_JsonIter-16         27014             43342 ns/op         970.46 MB/s       18444 B/op          2 allocs/op
BenchmarkMarshalConcrete/StringEscaped_JsonIterStd-16      27126             46479 ns/op         904.96 MB/s       18444 B/op          2 allocs/op
BenchmarkMarshalConcrete/StringUnicode_Std-16              21002             48667 ns/op         372.41 MB/s       18432 B/op          1 allocs/op
BenchmarkMarshalConcrete/StringUnicode_StdV2-16            28323             41655 ns/op         435.10 MB/s       18433 B/op          1 allocs/op
BenchmarkMarshalConcrete/StringUnicode_Sonic-16           168824              7318 ns/op        2476.80 MB/s       18538 B/op          2 allocs/op
BenchmarkMarshalConcrete/StringUnicode_SonicStd-16         54193             21535 ns/op         841.60 MB/s       46041 B/op          3 allocs/op
BenchmarkMarshalConcrete/StringUnicode_GoJson-16           26140             43869 ns/op         413.14 MB/s       18436 B/op          1 allocs/op
BenchmarkMarshalConcrete/StringUnicode_JsonIter-16         29298             42563 ns/op         425.81 MB/s       18441 B/op          2 allocs/op
BenchmarkMarshalConcrete/StringUnicode_JsonIterStd-16      26731             40243 ns/op         450.36 MB/s       18441 B/op          2 allocs/op
BenchmarkMarshalConcrete/SyntheaFhir_Std-16                   91          13752771 ns/op         146.04 MB/s     3949530 B/op      18049 allocs/op
BenchmarkMarshalConcrete/SyntheaFhir_StdV2-16                 92          13155959 ns/op         152.67 MB/s     3577204 B/op      20742 allocs/op
BenchmarkMarshalConcrete/SyntheaFhir_Sonic-16                100          10189599 ns/op         197.11 MB/s     3988444 B/op      17937 allocs/op
BenchmarkMarshalConcrete/SyntheaFhir_SonicStd-16              90          13566273 ns/op         148.05 MB/s     8804326 B/op      17942 allocs/op
BenchmarkMarshalConcrete/SyntheaFhir_GoJson-16               171           7018162 ns/op         286.19 MB/s     3945604 B/op      17941 allocs/op
BenchmarkMarshalConcrete/SyntheaFhir_JsonIter-16             100          10875576 ns/op         184.68 MB/s     4030139 B/op      15680 allocs/op
BenchmarkMarshalConcrete/SyntheaFhir_JsonIterStd-16           91          13149111 ns/op         152.75 MB/s     5443346 B/op      33925 allocs/op
BenchmarkMarshalConcrete/TwitterStatus_Std-16               1177           1023556 ns/op         616.98 MB/s      517052 B/op        201 allocs/op
BenchmarkMarshalConcrete/TwitterStatus_StdV2-16              958           1195769 ns/op         528.12 MB/s      500613 B/op         49 allocs/op
BenchmarkMarshalConcrete/TwitterStatus_Sonic-16             1660            720113 ns/op         876.96 MB/s      499981 B/op          2 allocs/op
BenchmarkMarshalConcrete/TwitterStatus_SonicStd-16          1334            881509 ns/op         716.40 MB/s     1263782 B/op          3 allocs/op
BenchmarkMarshalConcrete/TwitterStatus_GoJson-16            1480            711340 ns/op         887.78 MB/s      508932 B/op          6 allocs/op
BenchmarkMarshalConcrete/TwitterStatus_JsonIter-16           903           1307091 ns/op         483.14 MB/s      510419 B/op         52 allocs/op
BenchmarkMarshalConcrete/TwitterStatus_JsonIterStd-16        906           1260941 ns/op         500.83 MB/s      551899 B/op        182 allocs/op
BenchmarkMarshalInterface/CanadaGeometry_Std-16              386           3178560 ns/op          85.07 MB/s      279744 B/op         31 allocs/op
BenchmarkMarshalInterface/CanadaGeometry_StdV2-16            549           2174318 ns/op         124.36 MB/s      278550 B/op          2 allocs/op
BenchmarkMarshalInterface/CanadaGeometry_Sonic-16            715           1714088 ns/op         157.75 MB/s      278588 B/op          2 allocs/op
BenchmarkMarshalInterface/CanadaGeometry_SonicStd-16         662           1911766 ns/op         141.44 MB/s      689306 B/op          3 allocs/op
BenchmarkMarshalInterface/CanadaGeometry_GoJson-16           441           2577606 ns/op         104.90 MB/s      278796 B/op          3 allocs/op
BenchmarkMarshalInterface/CanadaGeometry_JsonIter-16         416           2776412 ns/op          97.39 MB/s      279062 B/op         14 allocs/op
BenchmarkMarshalInterface/CanadaGeometry_JsonIterStd-16                      436           2921426 ns/op          92.56 MB/s      279830 B/op         34 allocs/op
BenchmarkMarshalInterface/CitmCatalog_Std-16                                  94          11776974 ns/op         146.66 MB/s     4479194 B/op      95477 allocs/op
BenchmarkMarshalInterface/CitmCatalog_StdV2-16                               356           3243645 ns/op         532.49 MB/s      507935 B/op          2 allocs/op
BenchmarkMarshalInterface/CitmCatalog_Sonic-16                               300           3805198 ns/op         453.91 MB/s      508012 B/op          2 allocs/op
BenchmarkMarshalInterface/CitmCatalog_SonicStd-16                            286           4177647 ns/op         413.44 MB/s     1262426 B/op          3 allocs/op
BenchmarkMarshalInterface/CitmCatalog_GoJson-16                              256           4696862 ns/op         367.74 MB/s      651339 B/op        321 allocs/op
BenchmarkMarshalInterface/CitmCatalog_JsonIter-16                            200           5504982 ns/op         313.75 MB/s     1907952 B/op      32813 allocs/op
BenchmarkMarshalInterface/CitmCatalog_JsonIterStd-16                         100          10512463 ns/op         164.30 MB/s     4458811 B/op      93519 allocs/op
BenchmarkMarshalInterface/GolangSource_Std-16                                 33          33450841 ns/op          58.01 MB/s    12289714 B/op     230517 allocs/op
BenchmarkMarshalInterface/GolangSource_StdV2-16                               93          10803907 ns/op         179.61 MB/s     1941602 B/op          2 allocs/op
BenchmarkMarshalInterface/GolangSource_Sonic-16                              100          10731769 ns/op         180.82 MB/s     1947368 B/op          2 allocs/op
BenchmarkMarshalInterface/GolangSource_SonicStd-16                            92          12220528 ns/op         158.79 MB/s     4867726 B/op          4 allocs/op
BenchmarkMarshalInterface/GolangSource_GoJson-16                              51          19992069 ns/op          97.06 MB/s     2653634 B/op          3 allocs/op
BenchmarkMarshalInterface/GolangSource_JsonIter-16                            76          15053078 ns/op         128.91 MB/s     3580997 B/op      38423 allocs/op
BenchmarkMarshalInterface/GolangSource_JsonIterStd-16                         36          32356213 ns/op          59.97 MB/s    13116755 B/op     192104 allocs/op
BenchmarkMarshalInterface/StringEscaped_Std-16                             19969             60356 ns/op         696.90 MB/s       24585 B/op        125 allocs/op
BenchmarkMarshalInterface/StringEscaped_StdV2-16                           29420             41864 ns/op        1004.72 MB/s       18440 B/op          2 allocs/op
BenchmarkMarshalInterface/StringEscaped_Sonic-16                          113176             12288 ns/op        3423.04 MB/s       18483 B/op          2 allocs/op
BenchmarkMarshalInterface/StringEscaped_SonicStd-16                        34449             32527 ns/op        1293.14 MB/s       45898 B/op          3 allocs/op
BenchmarkMarshalInterface/StringEscaped_GoJson-16                          19056             56370 ns/op         746.17 MB/s       18443 B/op          1 allocs/op
BenchmarkMarshalInterface/StringEscaped_JsonIter-16                        27636             40751 ns/op        1032.16 MB/s       18568 B/op          5 allocs/op
BenchmarkMarshalInterface/StringEscaped_JsonIterStd-16                     21590             55279 ns/op         760.90 MB/s       24918 B/op         73 allocs/op
BenchmarkMarshalInterface/StringUnicode_Std-16                             19791             60464 ns/op         299.75 MB/s       24585 B/op        125 allocs/op
BenchmarkMarshalInterface/StringUnicode_StdV2-16                           29931             40505 ns/op         447.45 MB/s       18440 B/op          2 allocs/op
BenchmarkMarshalInterface/StringUnicode_Sonic-16                          123574              9573 ns/op        1893.24 MB/s       18499 B/op          2 allocs/op
BenchmarkMarshalInterface/StringUnicode_SonicStd-16                        48205             25270 ns/op         717.22 MB/s       45836 B/op          3 allocs/op
BenchmarkMarshalInterface/StringUnicode_GoJson-16                          22987             52510 ns/op         345.15 MB/s       18449 B/op          1 allocs/op
BenchmarkMarshalInterface/StringUnicode_JsonIter-16                        29917             40199 ns/op         450.86 MB/s       18568 B/op          5 allocs/op
BenchmarkMarshalInterface/StringUnicode_JsonIterStd-16                     21805             54620 ns/op         331.82 MB/s       24935 B/op         73 allocs/op
BenchmarkMarshalInterface/SyntheaFhir_Std-16                                  67          15925025 ns/op         126.12 MB/s     6569132 B/op     131963 allocs/op
BenchmarkMarshalInterface/SyntheaFhir_StdV2-16                               249           4733349 ns/op         424.33 MB/s     1146946 B/op          2 allocs/op
BenchmarkMarshalInterface/SyntheaFhir_Sonic-16                               192           6129065 ns/op         327.70 MB/s     1148529 B/op          2 allocs/op
BenchmarkMarshalInterface/SyntheaFhir_SonicStd-16                            164           7226055 ns/op         277.95 MB/s     2873808 B/op          4 allocs/op
BenchmarkMarshalInterface/SyntheaFhir_GoJson-16                              132           8929492 ns/op         224.93 MB/s     2477839 B/op       6468 allocs/op
BenchmarkMarshalInterface/SyntheaFhir_JsonIter-16                            150           7811190 ns/op         257.13 MB/s     3079471 B/op      45293 allocs/op
BenchmarkMarshalInterface/SyntheaFhir_JsonIterStd-16                          70          16048116 ns/op         125.15 MB/s     7493396 B/op     134183 allocs/op
BenchmarkMarshalInterface/TwitterStatus_Std-16                               234           5066147 ns/op         124.65 MB/s     1919658 B/op      31055 allocs/op
BenchmarkMarshalInterface/TwitterStatus_StdV2-16                             744           1614621 ns/op         391.12 MB/s      466976 B/op          2 allocs/op
BenchmarkMarshalInterface/TwitterStatus_Sonic-16                             706           1646210 ns/op         383.62 MB/s      467038 B/op          2 allocs/op
BenchmarkMarshalInterface/TwitterStatus_SonicStd-16                          441           2665859 ns/op         236.89 MB/s     1180512 B/op          3 allocs/op
BenchmarkMarshalInterface/TwitterStatus_GoJson-16                            294           6239187 ns/op         101.22 MB/s     1033628 B/op        537 allocs/op
BenchmarkMarshalInterface/TwitterStatus_JsonIter-16                          219           6089665 ns/op         103.70 MB/s      636964 B/op       3794 allocs/op
BenchmarkMarshalInterface/TwitterStatus_JsonIterStd-16                       186           6015558 ns/op         104.98 MB/s     2452462 B/op      22557 allocs/op

@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2024

Codecov Report

Attention: 764 lines in your changes are missing coverage. Please review.

Comparison is base (9f2242e) 78.53% compared to head (ab9ed87) 69.41%.
Report is 6 commits behind head on test/aarch64.

Files Patch % Lines
internal/encoder/vm/vm.go 27.14% 198 Missing and 6 partials ⚠️
internal/encoder/compiler.go 57.76% 178 Missing and 15 partials ⚠️
internal/encoder/alg/spec_amd64.go 0.00% 110 Missing ⚠️
internal/encoder/x86/debug_go117.go 1.26% 77 Missing and 1 partial ⚠️
internal/encoder/x86/assembler_regabi_amd64.go 91.72% 44 Missing and 7 partials ⚠️
internal/encoder/alg/mapiter.go 0.00% 40 Missing and 1 partial ⚠️
internal/encoder/alg/primitives.go 0.00% 34 Missing ⚠️
internal/encoder/pools_amd64.go 26.47% 22 Missing and 3 partials ⚠️
internal/encoder/encoder.go 55.17% 12 Missing and 1 partial ⚠️
internal/encoder/vm/stbus.go 36.36% 3 Missing and 4 partials ⚠️
... and 3 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@               Coverage Diff                @@
##           test/aarch64     #580      +/-   ##
================================================
- Coverage         78.53%   69.41%   -9.13%     
================================================
  Files                69       65       -4     
  Lines             10836     8664    -2172     
================================================
- Hits               8510     6014    -2496     
- Misses             1947     2310     +363     
+ Partials            379      340      -39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@liuq19 liuq19 merged commit 1cb4034 into test/aarch64 Feb 1, 2024
6 of 24 checks passed
@liuq19 liuq19 deleted the feat/encoder_vm branch February 1, 2024 05:05
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.

3 participants