Skip to content

Commit

Permalink
Merge pull request #766 from samchon/benchamrk/typoebox
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon authored Aug 19, 2023
2 parents ef88a0b + 9b654af commit ef8b97a
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions benchmark/structures/typebox/TypeboxArrayHierarchical.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const Timestamp = Type.Object({
time: Type.Number(),
Expand Down Expand Up @@ -31,8 +31,8 @@ const Company = Type.Object({
departments: Type.Array(Department),
});

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxArrayHierarchical = Type.Array(Company);
export const TypeboxArrayHierarchical = TypeCompiler.Compile(
Expand Down
6 changes: 3 additions & 3 deletions benchmark/structures/typebox/TypeboxArrayRecursive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const Timestamp = Type.Object({
time: Type.Number(),
Expand All @@ -17,8 +17,8 @@ const Category = Type.Recursive((Category) =>
}),
);

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxArrayRecursive = Category;
export const TypeboxArrayRecursive = TypeCompiler.Compile(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TSchema, Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const ImageFile = Type.Object({
id: Type.Number(),
Expand Down Expand Up @@ -63,8 +63,8 @@ const Bucket = Type.Recursive((Bucket) =>
]),
);

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxArrayRecursiveUnionExplicit = Type.Array(Bucket);
export const TypeboxArrayRecursiveUnionExplicit = TypeCompiler.Compile(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TSchema, Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const ImageFile = Type.Object({
id: Type.Number(),
Expand Down Expand Up @@ -64,8 +64,8 @@ const Bucket = Type.Recursive((bucket) =>
]),
);

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxArrayRecursiveUnionImplicit = Type.Array(Bucket);
export const TypeboxArrayRecursiveUnionImplicit = TypeCompiler.Compile(
Expand Down
6 changes: 3 additions & 3 deletions benchmark/structures/typebox/TypeboxArraySimple.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const Hobby = Type.Object({
name: Type.String(),
Expand All @@ -21,8 +21,8 @@ const Person = Type.Object({
]),
});

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxArraySimple = Type.Array(Person);
export const TypeboxArraySimple = TypeCompiler.Compile(__TypeboxArraySimple);
6 changes: 3 additions & 3 deletions benchmark/structures/typebox/TypeboxObjectHierarchical.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const Timestamp = Type.Object({
time: Type.Number(),
Expand Down Expand Up @@ -56,8 +56,8 @@ const Customer = Type.Object({
created_at: Timestamp,
});

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxObjectHierarchical = Customer;
export const TypeboxObjectHierarchical = TypeCompiler.Compile(
Expand Down
6 changes: 3 additions & 3 deletions benchmark/structures/typebox/TypeboxObjectRecursive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const Timestamp = Type.Object({
time: Type.Number(),
Expand All @@ -18,8 +18,8 @@ const Department = Type.Recursive((Department) =>
}),
);

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxObjectRecursive = Department;
export const TypeboxObjectRecursive = TypeCompiler.Compile(
Expand Down
6 changes: 3 additions & 3 deletions benchmark/structures/typebox/TypeboxObjectSimple.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const Point3D = Type.Object({
x: Type.Number(),
Expand All @@ -15,8 +15,8 @@ const Box3D = Type.Object({
pivot: Point3D,
});

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxObjectSimple = Box3D;
export const TypeboxObjectSimple = TypeCompiler.Compile(__TypeboxObjectSimple);
6 changes: 3 additions & 3 deletions benchmark/structures/typebox/TypeboxObjectUnionExplicit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const Point = Type.Object({
x: Type.Number(),
Expand Down Expand Up @@ -80,8 +80,8 @@ const Union = Type.Union([
]),
]);

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxObjectUnionExplicit = Type.Array(Union);
export const TypeboxObjectUnionExplicit = TypeCompiler.Compile(
Expand Down
6 changes: 3 additions & 3 deletions benchmark/structures/typebox/TypeboxObjectUnionImplicit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const Point = Type.Object({
x: Type.Number(),
Expand Down Expand Up @@ -54,8 +54,8 @@ const Union = Type.Union([
Circle,
]);

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxObjectUnionImplicit = Type.Array(Union);
export const TypeboxObjectUnionImplicit = TypeCompiler.Compile(
Expand Down
6 changes: 3 additions & 3 deletions benchmark/structures/typebox/TypeboxUltimateUnion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TSchema, Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { TypeSystem } from "@sinclair/typebox/system";
import { TypeSystemPolicy } from "@sinclair/typebox/system";

const Attribute = {
description: Type.Optional(Type.String()),
Expand Down Expand Up @@ -129,8 +129,8 @@ const Schema = Type.Recursive((schema) =>
]),
);

TypeSystem.AllowArrayObjects = true;
TypeSystem.AllowNaN = true;
TypeSystemPolicy.AllowArrayObject = true;
TypeSystemPolicy.AllowNaN = true;

export const __TypeboxUltimateUnion = Type.Array(Application(Schema));
export const TypeboxUltimateUnion = TypeCompiler.Compile(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"typescript": ">= 4.7.4"
},
"devDependencies": {
"@fastify/type-provider-typebox": "^3.0.0",
"@fastify/type-provider-typebox": "^3.5.0",
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
"@typegoose/typegoose": "^10.1.1",
"@types/autocannon": "^7.9.0",
Expand Down

0 comments on commit ef8b97a

Please sign in to comment.