1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Get rid of 'builtins' file since its useless and causes performance issues

This commit is contained in:
tobspr
2020-06-27 10:51:52 +02:00
parent 14246929b3
commit 2e266f5f21
60 changed files with 256 additions and 403 deletions

View File

@@ -209,7 +209,7 @@ export class Savegame extends ReadWriteProxy {
// Construct a new serializer
const serializer = new SavegameSerializer();
// let timer = performanceNow();
// let timer = performance.now();
const dump = serializer.generateDumpFromGameRoot(root);
if (!dump) {
return false;

View File

@@ -3,8 +3,6 @@ import { createLogger } from "../core/logging";
import { ReadWriteProxy } from "../core/read_write_proxy";
import { globalConfig } from "../core/config";
import { Savegame } from "./savegame";
import { Math_floor } from "../core/builtins";
const logger = createLogger("savegame_manager");
const Rusha = require("rusha");

View File

@@ -3,7 +3,6 @@ import { Component } from "../game/component";
import { GameRoot } from "../game/root";
/* typehints:end */
import { JSON_stringify } from "../core/builtins";
import { ExplainedResult } from "../core/explained_result";
import { createLogger } from "../core/logging";
// import { BuildingComponent } from "../components/impl/building";
@@ -88,7 +87,7 @@ export class SavegameSerializer {
// Verify components
if (!entity.components) {
return ExplainedResult.bad(
"Entity is missing key 'components': " + JSON_stringify(entity)
"Entity is missing key 'components': " + JSON.stringify(entity)
);
}
const components = entity.components;

View File

@@ -1,4 +1,3 @@
import { JSON_stringify } from "../core/builtins";
import {
BaseDataType,
TypeArray,
@@ -223,7 +222,7 @@ export function serializeSchema(obj, schema, mergeWith = {}) {
);
}
if (!schema[key]) {
assert(false, "Invalid schema (bad key '" + key + "'): " + JSON_stringify(schema));
assert(false, "Invalid schema (bad key '" + key + "'): " + JSON.stringify(schema));
}
if (G_IS_DEV) {

View File

@@ -5,8 +5,6 @@ import { BasicSerializableObject } from "./serialization";
import { Vector } from "../core/vector";
import { round4Digits, schemaObject, accessNestedPropertyReverse } from "../core/utils";
import { JSON_stringify } from "../core/builtins";
export const globalJsonSchemaDefs = {};
/**
@@ -128,7 +126,7 @@ export class BaseDataType {
"serialization verify failed: " +
errorCode +
" [value " +
JSON_stringify(value).substr(0, 100) +
JSON.stringify(value).substr(0, 100) +
"]"
);
}