Skip to content

fix(perf): lazy log#457

Merged
1-leo merged 6 commits intomasterfrom
fix/performance/evalute-log-level-first
Feb 22, 2026
Merged

fix(perf): lazy log#457
1-leo merged 6 commits intomasterfrom
fix/performance/evalute-log-level-first

Conversation

@1-leo
Copy link
Contributor

@1-leo 1-leo commented Feb 21, 2026

calling Nip01Event.toString() is expensive, refactored to:
Logger.log.d(()=>e); to evaluate the msg lazy (only if the log level requires it)

@1-leo 1-leo requested review from frnandu and nogringo February 21, 2026 11:43
@1-leo 1-leo self-assigned this Feb 21, 2026
@1-leo 1-leo added the refactor label Feb 21, 2026
@1-leo 1-leo added this to ndk-dev Feb 21, 2026
@1-leo 1-leo moved this to In Progress in ndk-dev Feb 21, 2026
@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.35%. Comparing base (45cfb84) to head (6dac94c).

Files with missing lines Patch % Lines
...s/ndk/lib/domain_layer/usecases/relay_manager.dart 52.70% 35 Missing ⚠️
...k/lib/domain_layer/usecases/relay_sets_engine.dart 22.22% 7 Missing ⚠️
...ackages/ndk/lib/domain_layer/usecases/nwc/nwc.dart 0.00% 5 Missing ⚠️
...kages/ndk/lib/domain_layer/usecases/zaps/zaps.dart 0.00% 5 Missing ⚠️
.../lib/domain_layer/usecases/nwc/nwc_connection.dart 0.00% 4 Missing ⚠️
...k/lib/domain_layer/usecases/requests/requests.dart 25.00% 3 Missing ⚠️
...es/ndk/lib/domain_layer/entities/contact_list.dart 0.00% 2 Missing ⚠️
...ges/ndk/lib/domain_layer/entities/nip_51_list.dart 0.00% 2 Missing ⚠️
...lib/domain_layer/usecases/metadatas/metadatas.dart 60.00% 2 Missing ⚠️
...k/lib/data_layer/repositories/lnurl_http_impl.dart 50.00% 1 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #457      +/-   ##
==========================================
- Coverage   75.60%   75.35%   -0.25%     
==========================================
  Files         148      148              
  Lines        5886     5905      +19     
==========================================
  Hits         4450     4450              
- Misses       1436     1455      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@nogringo nogringo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update the documentation Logger.log.w('Warning message');

@1-leo 1-leo requested a review from nogringo February 22, 2026 10:26
@1-leo 1-leo merged commit 8ac52f5 into master Feb 22, 2026
5 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in ndk-dev Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants