Skip to content

Commit

Permalink
refactor: set enableMassiveParsedStyleAssignOptimization to default
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarebecca committed Nov 25, 2024
1 parent 6f347e4 commit ccad436
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 16 deletions.
2 changes: 0 additions & 2 deletions __tests__/demos/bugfix/group-with-stroke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Group, Path, Rect, runtime } from '@antv/g';
export async function group_with_stroke(context) {
const { canvas } = context;

runtime.enableMassiveParsedStyleAssignOptimization = true;

await canvas.ready;

const group = new Group({
Expand Down
2 changes: 0 additions & 2 deletions __tests__/demos/perf/massive-attrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Rect, runtime } from '@antv/g';
export async function massiveAttrs(context) {
const { canvas, gui } = context;

runtime.enableMassiveParsedStyleAssignOptimization = true;

await canvas.ready;

console.time('massiveAttrs');
Expand Down
7 changes: 1 addition & 6 deletions packages/g-lite/src/css/StyleValueRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isNil, isUndefined } from '@antv/util';
import { vec3 } from 'gl-matrix';
import type { DisplayObject } from '../display-objects';
import { EMPTY_PARSED_PATH } from '../display-objects/constants';
import { runtime, type GlobalRuntime } from '../global-runtime';
import type { GlobalRuntime } from '../global-runtime';
import { GeometryAABBUpdater } from '../services';
import { AABB } from '../shapes';
import type { BaseStyleProps, Tuple3Number } from '../types';
Expand Down Expand Up @@ -1007,11 +1007,6 @@ function assignParsedStyle(
object: DisplayObject,
attributes: Record<string, any>,
) {
if (!runtime.enableMassiveParsedStyleAssignOptimization) {
Object.assign(object.parsedStyle, attributes);
return;
}

const list = getParsedStyleListOf(object);
for (const key in attributes) {
if (list.has(key)) {
Expand Down
6 changes: 0 additions & 6 deletions packages/g-lite/src/global-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ export interface GlobalRuntime {
enableStyleSyntax: boolean;

enableSizeAttenuation: boolean;

/**
* Only clone properties that are listed in the `PARSED_STYLE_LIST` of the display object.
* default false
*/
enableMassiveParsedStyleAssignOptimization?: boolean;
}

/**
Expand Down

0 comments on commit ccad436

Please sign in to comment.