Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 3a01dc2

Browse files
committed
fixed agile bench
1 parent 21a4deb commit 3a01dc2

File tree

8 files changed

+47
-23
lines changed

8 files changed

+47
-23
lines changed

benchmark/benchmarks/react/1000fields/bench/agilets/collection.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import { createCollection } from '@agile-ts/core';
4-
import { useAgile, useValue } from '@agile-ts/react';
3+
import { createCollection, shared } from '@agile-ts/core';
4+
import reactIntegration, { useAgile, useValue } from '@agile-ts/react';
5+
import { assignSharedAgileLoggerConfig } from '@agile-ts/logger';
6+
7+
assignSharedAgileLoggerConfig({ active: false });
8+
shared.integrate(reactIntegration);
59

610
export default function (target: HTMLElement, fieldsCount: number) {
711
const FIELDS = createCollection({

benchmark/benchmarks/react/1000fields/bench/agilets/nestedState.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import * as React from 'react';
22
import * as ReactDom from 'react-dom';
3-
import { createState, State } from '@agile-ts/core';
4-
import { useAgile } from '@agile-ts/react';
3+
import { createState, shared, State } from '@agile-ts/core';
4+
import reactIntegration, { useAgile } from '@agile-ts/react';
5+
import { assignSharedAgileLoggerConfig } from '@agile-ts/logger';
6+
7+
assignSharedAgileLoggerConfig({ active: false });
8+
shared.integrate(reactIntegration);
59

610
export default function (target: HTMLElement, fieldsCount: number) {
711
const FIELDS = createState(

benchmark/benchmarks/react/1000fields/bench/agilets/state.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import { createState } from '@agile-ts/core';
4-
import { useAgile } from '@agile-ts/react';
3+
import { createState, shared } from '@agile-ts/core';
4+
import reactIntegration, { useAgile } from '@agile-ts/react';
5+
import { assignSharedAgileLoggerConfig } from '@agile-ts/logger';
6+
7+
assignSharedAgileLoggerConfig({ active: false });
8+
shared.integrate(reactIntegration);
59

610
export default function (target: HTMLElement, fieldsCount: number) {
711
const FIELDS = createState(

benchmark/benchmarks/react/computed/bench/agilets/autoTracking.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import { createComputed, createState } from '@agile-ts/core';
4-
import { useAgile } from '@agile-ts/react';
3+
import { createComputed, createState, shared } from '@agile-ts/core';
4+
import reactIntegration, { useAgile } from '@agile-ts/react';
5+
import { assignSharedAgileLoggerConfig } from '@agile-ts/logger';
6+
7+
assignSharedAgileLoggerConfig({ active: false });
8+
shared.integrate(reactIntegration);
59

610
const COUNT = createState(0);
711
const COMPUTED_COUNT = createComputed(() => {

benchmark/benchmarks/react/computed/bench/agilets/hardCoded.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import { createComputed, createState } from '@agile-ts/core';
4-
import { useAgile } from '@agile-ts/react';
3+
import { createComputed, createState, shared } from '@agile-ts/core';
4+
import reactIntegration, { useAgile } from '@agile-ts/react';
5+
import { assignSharedAgileLoggerConfig } from '@agile-ts/logger';
6+
7+
assignSharedAgileLoggerConfig({ active: false });
8+
shared.integrate(reactIntegration);
59

610
const COUNT = createState(0);
711
const COMPUTED_COUNT = createComputed(

benchmark/benchmarks/react/counter/bench/agilets.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import { createState } from '@agile-ts/core';
4-
import { useAgile } from '@agile-ts/react';
3+
import { createState, shared } from '@agile-ts/core';
4+
import reactIntegration, { useAgile } from '@agile-ts/react';
5+
import { assignSharedAgileLoggerConfig } from '@agile-ts/logger';
6+
7+
assignSharedAgileLoggerConfig({ active: false });
8+
shared.integrate(reactIntegration);
59

610
const COUNT = createState(0);
711

benchmark/benchmarks/react/counter/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ const results: CycleResultInterface[] = [];
6464
// Add Tests to the Benchmark Test Suite
6565
suite
6666
.add('AgileTs', configTest(agilets))
67-
// .add('Hookstate', configTest(hookstate))
68-
// .add('Jotai', configTest(jotai))
69-
// .add('Mobx', configTest(mobx))
70-
// .add('Nano Stores', configTest(nanostores))
71-
// .add('PulseJs', configTest(pulsejs))
72-
// .add('Recoil', configTest(recoil))
73-
// .add('Redux', configTest(redux))
74-
// .add('Redux-Toolkit', configTest(reduxToolkit))
75-
// .add('Valtio', configTest(valtio))
76-
// .add('Zustand', configTest(zustand))
67+
.add('Hookstate', configTest(hookstate))
68+
.add('Jotai', configTest(jotai))
69+
.add('Mobx', configTest(mobx))
70+
.add('Nano Stores', configTest(nanostores))
71+
.add('PulseJs', configTest(pulsejs))
72+
.add('Recoil', configTest(recoil))
73+
.add('Redux', configTest(redux))
74+
.add('Redux-Toolkit', configTest(reduxToolkit))
75+
.add('Valtio', configTest(valtio))
76+
.add('Zustand', configTest(zustand))
7777

7878
// Add Listener
7979
.on('start', function (this: any) {

packages/core/src/logCodeManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ function logIfTags<T extends LogCodesArrayType<typeof logCodeMessages>>(
258258
* @internal
259259
*/
260260
let tempLogCodeManager;
261-
if (process.env.NODE_ENV === 'dev') {
261+
if (typeof process === 'object' && process.env.NODE_ENV !== 'production') {
262262
tempLogCodeManager = {
263263
getLog,
264264
log,

0 commit comments

Comments
 (0)