purpleidea / mgmt

Next generation distributed, event-driven, parallel config management!
https://purpleidea.com/tags/mgmtconfig/
GNU General Public License v3.0
3.47k stars 308 forks source link

replace Strings that are passed around with Iota #736

Open igalic opened 5 months ago

igalic commented 5 months ago

Description:

Currently, we have a lot of strings that denote meaning that are being passed around a lot.

We should replace those with a Iotas. This should give us a small performance boost.

If they do need to be used as actual strings, we can implement a toString function for that: https://golangbyexample.com/iota-in-golang/

purpleidea commented 5 months ago

Some context: This was discussed in our CfgMgmtCamp hackathon... The idea was that by using an iota to store the resource kind, we'd save a bunch of memory by not holding the "string" everywhere.

Thanks @igalic for writing it up!