1
0
mirror of https://github.com/netsampler/goflow2.git synced 2024-05-06 15:54:52 +00:00

2 Commits

Author SHA1 Message Date
00c77d7605 decoders: improve BasicTemplateSystem (#233)
* Use write lock when removing template

Since template removal modifies the template set map, it should be done
while holding a write lock, instead of a read lock.

* Optimize BasicTemplateSystem

The BasicTemplateSystem that comes with the library uses a 3-level map
to hold template information to avoid templateId and obsDomainId
collision between multiple protocols and hosts. However, the same can be
done by using a single map with a 64-bit key consisting of version,
templateId and obsDomainId.

This greatly simplifies the code and reduces the number of map lookups
from 3 to 1 per call to GetTemplate.

Co-authored-by: Matheus Castanho <matheus.castanho@dcc.ufmg.br>
2023-11-04 16:04:36 -07:00
ae56e41786 refactor: v2 (#150) 2023-08-09 19:47:20 -07:00