MCPcopy Create free account
hub / github.com/apache/fory / createDatasets

Function createDatasets

benchmarks/javascript/benchmark.js:639–718  ·  view source on GitHub ↗
(root, schemaMismatch)

Source from the content-addressed store, hash-verified

637}
638
639function createDatasets(root, schemaMismatch) {
640 const StructType = root.lookupType("protobuf.NumericStruct");
641 const SampleType = root.lookupType("protobuf.Sample");
642 const MediaContentType = root.lookupType("protobuf.MediaContent");
643 const StructListType = root.lookupType("protobuf.NumericStructList");
644 const SampleListType = root.lookupType("protobuf.SampleList");
645 const MediaContentListType = root.lookupType("protobuf.MediaContentList");
646
647 const { writerSerializers, readerSerializers } =
648 createForyBenchmarks(schemaMismatch);
649
650 return [
651 {
652 key: "struct",
653 label: "NumericStruct",
654 createValue: createNumericStruct,
655 toProto: toProtoStruct,
656 fromProto: fromProtoStruct,
657 protoType: StructType,
658 foryWriter: writerSerializers.struct,
659 foryReader: readerSerializers.struct,
660 sizeKey: "struct",
661 },
662 {
663 key: "sample",
664 label: "Sample",
665 createValue: createSample,
666 toProto: toProtoSample,
667 fromProto: fromProtoSample,
668 protoType: SampleType,
669 foryWriter: writerSerializers.sample,
670 foryReader: readerSerializers.sample,
671 sizeKey: "sample",
672 },
673 {
674 key: "mediacontent",
675 label: "MediaContent",
676 createValue: createMediaContent,
677 toProto: toProtoMediaContent,
678 fromProto: fromProtoMediaContent,
679 protoType: MediaContentType,
680 foryWriter: writerSerializers.mediacontent,
681 foryReader: readerSerializers.mediacontent,
682 sizeKey: "media",
683 },
684 {
685 key: "structlist",
686 label: "NumericStructList",
687 createValue: createNumericStructList,
688 toProto: toProtoNumericStructList,
689 fromProto: fromProtoNumericStructList,
690 protoType: StructListType,
691 foryWriter: writerSerializers.structlist,
692 foryReader: readerSerializers.structlist,
693 sizeKey: "struct_list",
694 },
695 {
696 key: "samplelist",

Callers 1

mainFunction · 0.85

Calls 1

createForyBenchmarksFunction · 0.85

Tested by

no test coverage detected