aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-28 09:37:59 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-28 09:37:59 +0100
commit19e87d332f47acfa98f5c4a6646b3336008e45e7 (patch)
tree7518eacc2f0027ec1891f078f62dc1aa6fb8eedb
parentcdc6e3028ce0f84bd3a827d989096000cbd58d25 (diff)
measurement: Speculative performance change
Most timeslots do not have eight lchan. Use the subslots_per_lchan map to reduce the number of iterations. Looking at the ARM assembly showed that no loop-unrolling was done so this could be a speed up.
-rw-r--r--src/common/measurement.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/common/measurement.c b/src/common/measurement.c
index 774962d..f32adda 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -207,11 +207,24 @@ int lchan_build_rsl_ul_meas(struct gsm_lchan *lchan, uint8_t *buf)
return 3;
}
+/* Copied from OpenBSC and enlarged to _GSM_PCHAN_MAX */
+static const uint8_t subslots_per_pchan[_GSM_PCHAN_MAX] = {
+ [GSM_PCHAN_NONE] = 0,
+ [GSM_PCHAN_CCCH] = 0,
+ [GSM_PCHAN_CCCH_SDCCH4] = 4,
+ [GSM_PCHAN_TCH_F] = 1,
+ [GSM_PCHAN_TCH_H] = 2,
+ [GSM_PCHAN_SDCCH8_SACCH8C] = 8,
+ /* FIXME: what about dynamic TCH_F_TCH_H ? */
+ [GSM_PCHAN_TCH_F_PDCH] = 1,
+};
+
static int ts_meas_check_compute(struct gsm_bts_trx_ts *ts, uint32_t fn)
{
int i;
+ const int num_subslots = subslots_per_pchan[ts->pchan];
- for (i = 0; i < ARRAY_SIZE(ts->lchan); i++) {
+ for (i = 0; i < num_subslots; ++i) {
struct gsm_lchan *lchan = &ts->lchan[i];
if (lchan->state != LCHAN_S_ACTIVE)