CacheControl / CacheControl/json-rules-engine

Decreased Performance due to 'debug(...)' statements in production

Offen
#369 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
3.1k
Forks
507
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi @CacheControl
Hope your doing well 😄
First I'd like to thank you for the work done, this is a really useful package !

I'd like to point out a performance issue we are facing in production, there's a debug statement that is run while the addFact function is executed which cause a 2 seconds delay
```typescript
addFact (id, valueOrMethod, options) {
let factId = id
let fact
if (id instanceof Fact) {
factId = id.id
fact = id
} else {
fact = new Fact(id, valueOrMethod, options)
}
debug(`engine::addFact id:${factId}`) // <--- This one
this.facts.set(factId, fact)
return this
}
```
Here's our CPU Profiling

Screenshot 2024-07-11 at 11 40 17

Is there a way to disable the debug statements ? Otherwise it could be nice to add an option to disable them
Thanks !

If you would like, I would be glad to open a PR to address the following issue.

Have a nice day 😄

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.