my_app scans my_file (lets say: txt, csv, json, etc) and prints some data (let
s say: rows).
And I would like to edit my_file using GUI.
My question is can I get some performance dividing my_app into scan_print (part I) and edit_GUI (part II) parts. (speeding up scan_print part)?
How to divide (in case it is need to divide):
approach 1.
my_print.exe
my_GUI.exe
approach 2.
my_app.exe
my_gui.lib
approach X.
? ? ?
Or Rust compiler optimizing is well enough?
if by "dividing", you mean to build separate binary crates, instead of a single multi-functional binary, then the answer is probably, at least in theory.
at runtime, smaller binaries generally load faster, and should consume less OS resources. at build time, smaller code side could give the optimizer more opportunity to do its job.
but this is all in theory. like any performance related questions, the correct answer is always: measure, measure, and measure. "in theory it should be faster" doesn't always have measurable difference.
in practice, unless you are dealing with very large data set or your algorithm is very compute heavy, I would not put peformance as my top priority to make design decisions.
1 Like