Skip to content

About the binary size of compiled product using Diesel #2958

Answered by weiznich
SKTT1Ryze asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for opening this thread. I can understand your concerns that the use of generics can cause the size of compiled code to explode. That's generally true, at least if generics are used in a certain way. For diesel that's not that simple. I did a simple experiment here to demonstrate this. For this I wrote a simple small script to generate rust programs using diesel. It generates a file containing x times the function you provided above, where x can be passed via command line. Every function is called from main, so that we can be sure the compiler does not strip it out.

Script to generate rust programs using diesel
#!/usr/bin/env python3

import sys

out = sys.argv[1]
count = int(sys.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SKTT1Ryze
Comment options

Answer selected by SKTT1Ryze
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants