Skip to content

Commit

Permalink
enable eager segment initialization by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofusco authored and rgdoliveira committed Mar 11, 2024
1 parent 5df6e56 commit e867d4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static boolean isEagerSegmentCreation() {
void removeRule(TerminalNode tn, Collection<InternalWorkingMemory> wms, InternalRuleBase kBase);

class Holder {
private static final boolean EAGER_SEGMENT_CREATION = Boolean.parseBoolean(getConfig("drools.useEagerSegmentCreation", "false"));
private static final boolean EAGER_SEGMENT_CREATION = Boolean.parseBoolean(getConfig("drools.useEagerSegmentCreation", "true"));
private static final PhreakBuilder PHREAK_BUILDER = EAGER_SEGMENT_CREATION ? new EagerPhreakBuilder() : new LazyPhreakBuilder();
}
}
11 changes: 2 additions & 9 deletions drools-core/src/main/java/org/drools/core/reteoo/Rete.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.drools.core.reteoo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -56,13 +55,9 @@
*/
public class Rete extends ObjectSource implements ObjectSink {

private final Map<EntryPointId, EntryPointNode> entryPoints = new HashMap<>();


private static final long serialVersionUID = 510l;

private Map<EntryPointId, EntryPointNode> entryPoints;

private transient InternalRuleBase kBase;
private final InternalRuleBase kBase;

public Rete() {
this( null );
Expand All @@ -74,9 +69,7 @@ public Rete() {

public Rete(InternalRuleBase kBase) {
super( 0, RuleBasePartitionId.MAIN_PARTITION );
this.entryPoints = Collections.synchronizedMap( new HashMap<>() );
this.kBase = kBase;

hashcode = calculateHashCode();
}

Expand Down

0 comments on commit e867d4c

Please sign in to comment.