Skip to content

Commit

Permalink
22278: Reduces transactional load time (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
howsohazard authored Nov 20, 2024
1 parent b334ac2 commit 3f9a2f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 2 additions & 0 deletions src/Amalgam/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ std::tuple<EvaluableNodeReference, std::vector<std::string>, size_t> Parser::Par
{
preevaluationNodes.clear();
parentNodes.clear();
//since the type of parentNodes can be expensive to iterate over, reduce the size
parentNodes.shrink_to_fit();

EvaluableNode *top_node = ParseCode();

Expand Down
6 changes: 0 additions & 6 deletions src/Amalgam/evaluablenode/EvaluableNodeManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
Concurrency::ReadWriteMutex EvaluableNodeManager::memoryModificationMutex;
#endif


#if defined(MULTITHREAD_SUPPORT) || defined(MULTITHREAD_INTERFACE)
thread_local
#endif
EvaluableNode::ReferenceAssocType EvaluableNodeManager::nodeToParentNodeCache;

const double EvaluableNodeManager::allocExpansionFactor = 1.5;

EvaluableNodeManager::~EvaluableNodeManager()
Expand Down
11 changes: 2 additions & 9 deletions src/Amalgam/evaluablenode/EvaluableNodeManagement.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,8 @@ class EvaluableNodeManager
if(tree == nullptr)
return;

nodeToParentNodeCache.clear();
UpdateFlagsForNodeTreeRecurse(tree, nullptr, nodeToParentNodeCache);
EvaluableNode::ReferenceAssocType node_to_parent_cache;
UpdateFlagsForNodeTreeRecurse(tree, nullptr, node_to_parent_cache);
}

//updates idempotency flags for tree and returns true if tree is idempotent
Expand Down Expand Up @@ -1105,13 +1105,6 @@ class EvaluableNodeManager
//only allocated if needed
std::unique_ptr<NodesReferenced> nodesCurrentlyReferenced;

//buffer used for updating EvaluableNodeFlags, particularly UpdateFlagsForNodeTree
#if defined(MULTITHREAD_SUPPORT) || defined(MULTITHREAD_INTERFACE)
thread_local
#endif
static EvaluableNode::ReferenceAssocType nodeToParentNodeCache;


//extra space to allocate when allocating
static const double allocExpansionFactor;
};

0 comments on commit 3f9a2f0

Please sign in to comment.