please, don't mind what the actual code does (nothing) but the proof of concept: is there any performance hit in using method "1"?
code sample 1:
declaring the ByteConverter locally to the sub that uses it (more readability, all resources used by the sub are local)
code sample 2:
declaring the ByteConverter once and globally (less readability)
local ByteConverter (1)
Public Sub TestSub(data() As Byte)
For i = 0 To 1000
ProcessBytes(data)
Next
End Sub
Public Sub ProcessBytes(data() As Byte)
Dim bc As ByteConverter
Log(bc.HexFromBytes(data))
End Sub
global ByteConverter (2)
Sub Class_Globals
Dim bc As ByteConverter
End Sub
Public Sub TestSub(data() As Byte)
For i = 0 To 1000
ProcessBytes(data)
Next
End Sub
Public Sub ProcessBytes(data() As Byte)
Log(bc.HexFromBytes(data))
End Sub