type AttributeInfo struct {
base64 bool // attribute's text is always encoded base64
name String // static string to use for attribute's name
}
var LDIFToHashInfo map[[]byte]AttributeInfo
The map maps names as the occur in LDIFs like "Template" and "Templates" to an AttributeInfo. This serves 2 purposes:
a) This mapping is done before extracting the attibute name as a string and therefore prevents the creation of 10000 copies of a string like "Template" because only the 1 static string will be used.
b) If base64 is true and the LDIF value is already base64 encoded, then it will not be decoded. If it is not encoded, it will be encoded. This means that the call to EncodeBase64 in db/hooks.go:PackageListHook() can be eliminated and again we save the creation of multiple intermediate buffers.
From matthias...@gmail.com on April 02, 2013 16:41:13
type AttributeInfo struct { base64 bool // attribute's text is always encoded base64 name String // static string to use for attribute's name }
var LDIFToHashInfo map[[]byte]AttributeInfo
The map maps names as the occur in LDIFs like "Template" and "Templates" to an AttributeInfo. This serves 2 purposes:
a) This mapping is done before extracting the attibute name as a string and therefore prevents the creation of 10000 copies of a string like "Template" because only the 1 static string will be used.
b) If base64 is true and the LDIF value is already base64 encoded, then it will not be decoded. If it is not encoded, it will be encoded. This means that the call to EncodeBase64 in db/hooks.go:PackageListHook() can be eliminated and again we save the creation of multiple intermediate buffers.
Original issue: http://code.google.com/p/go-susi/issues/detail?id=110