-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Used Claude to find a problem with syntax like this:
functions:
# Import inside code: (runs on every message - inefficient but works)
log_action_count:
type: forEach
code: |
from processor_functions import log_user_action_count
log_user_action_count(key, value, log)
The Problem
When using code: for imports, the import statement executes on every message:
# Generated code when using code: for import
def log_action_count(key, value):
from processor_functions import log_user_action_count # RUNS EVERY CALL
log_user_action_count(key, value, log)When using globalCode:, the import executes once at startup:
# Generated code when using globalCode: for import
from processor_functions import log_user_action_count # RUNS ONCE
def log_action_count(key, value):
log_user_action_count(key, value, log)Here is full description, proof and possible solutions by Claude
PR_422_IMPORT_OVERHEAD_ANALYSIS.md
Here is benchmark by Clade to prove the overhead:
When I ran it, I got this output:
Metadata
Metadata
Assignees
Labels
No labels