-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
per discussion elsewhere, it's much faster but only if you avoid lists. as @molpopgen summarized:
passing lists to
append_columnsis a performance killer, too. One solution for ftprime will be to use numpy arrays (with the correct dtypes, which I can write down in the README for my project when I get a moment...) and act like you're in C:
x = np.zeroes([INITIAL_SIZE], dtype = the_right_type)
x_size = 0 #dummy variable
# fill X with new data, and x_size += 1 each time
When appropriate, send the slice
x[:x_size]to the correct version ofappend_columns.
When filling, if
x_sizewill becomelen(x)after adding data, create a new array that's the concatenation ofxand a new empty array of sizeINITIAL_SIZE.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels