<p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25274">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25274/1/src/osmo-bsc/bsc_stats.c">File src/osmo-bsc/bsc_stats.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25274/1/src/osmo-bsc/bsc_stats.c@156">Patch Set #1, Line 156:</a> <code style="font-family:monospace,monospace">                   if (trx_is_usable(trx))</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Ah good point, I didn't think about trx_is_usable being a complex function :)</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">trx_is_usable() is absolutely not worth optimizing to avoid it.<br>It's just a shallow cascade of plain if()s and checking FSM status.<br>no point in nano optimisation here at all.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25274/2/src/osmo-bsc/osmo_bsc_main.c">File src/osmo-bsc/osmo_bsc_main.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25274/2/src/osmo-bsc/osmo_bsc_main.c@385">Patch Set #2, Line 385:</a> <code style="font-family:monospace,monospace"> * that should call this and failed to get accurate results; this trivial timer covers all of them. */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">@pespin, you've seen this comment, right?</p><p style="white-space: pre-wrap; word-wrap: break-word;">i really tried to find pivotal places in the code where to trigger updating the conn stats, but it's apparently a bit obscure. I spent considerable time on it, and then gave up because it was becoming a waste of time. This periodic check trivially covers all corner cases.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Doing this once a second cannot be considered load. We do much more effort every time we look up a trx, a conn, a subscriber, an unused lchan... on each and every incoming message.</p><p style="white-space: pre-wrap; word-wrap: break-word;">In general, please let's not discuss processor time optimization for algorithms <= O(n), it's plain irrelevant. If we want optimization, the first step should be benchmarked load testing; then we can focus on the actual proven CPU hogs. This is O(n) with n much smaller than 1k, run once every second. I took longer writing this comment than any osmo-bsc will take running this timer cb for the next ten years combined.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25274">change 25274</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bsc/+/25274"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I2057a798e681a169cc03243a09b3d6449734c010 </div>
<div style="display:none"> Gerrit-Change-Number: 25274 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 30 Aug 2021 16:36:40 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>