AxFoundation/strax

Save run_id field as string rather than unicode

Closed this issue · 1 comments

If we would save the run_id string as a string rather than unicode, we'd prevent unnecessary memory usage:

import numpy as np
>>> rs = np.empty(400*10**6, [('run_id', '<S6')])
>>> rs.nbytes/10**6
2400.0
>>> rs = np.empty(400*10**6, [('run_id', '<U6')])
>>> rs.nbytes/10**6
9600.0

Caveat

Your comparison will also have to use bytestings:

>>> b'1' == '1'
False

Fixed in #593