Attention is currently required from: Hoernchen, dexter, laforge.
lynxis lazus has posted comments on this change by Hoernchen. (
https://gerrit.osmocom.org/c/pysim/+/40468?usp=email )
Change subject: smdpp: less verbose by default
......................................................................
Patch Set 11:
(1 comment)
File osmo-smdpp.py:
https://gerrit.osmocom.org/c/pysim/+/40468/comment/3f22d345_a90cb5a9?usp=em… :
PS6, Line 370: logger.debug("Tx JSON: %s" %
json.dumps(output)[:200])
I fail to understand what exactly we are now
discussing here for a simple change from print to logge […]
1)
logger.debug("foo %s" % json.dumps(output)[:200]) will always do the
string.format() even in cases, when debug output isn't enabled.
However logger.debug() supports doing it, when debug is enabled by:
`logger.debug("foo %s", json.dumps(output)[:200])` (notice the , replaced the
%).
Improves performance.
2) json.dumps() is a very expensive operation, because of this, I thought it would be
worth checking, if it is a huge object, put it behind logger.isEnabledFor().
After a second look, I see the function is return the json object anyways as string, you
could save the json object in a variable and use logger as described in 1) to have the
best performance.
--
To view, visit
https://gerrit.osmocom.org/c/pysim/+/40468?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I04a72b8f52417862d4dcba1f0743700dd942ef49
Gerrit-Change-Number: 40468
Gerrit-PatchSet: 11
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 14 Aug 2025 18:24:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hoernchen <ewild(a)sysmocom.de>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: lynxis lazus <lynxis(a)fe80.eu>