Commit 98c782d
authored
Combine code for sparse model functions and their index files (#2159)
Combine code for sparse model functions and their index files, i.e. generate only a single file instead of 3 individual files for content, rowvals, and colptrs, respectively.
Advantage: Faster import of smaller models and fewer files. For a toy model, this reduced the build steps from 44 to 28, and reduced build time by >20% on my computer.
Disadvantage: None found, so I don't think it worth adding an option for (not) combining those files. For larger models, there shouldn't be any impact. The extra time for compiling the index arrays should be negligible compared to computing the contents.
Related to #2119
Here a test for a large model (N=1):
| File | Size | Compilation time (s) |
|--------------|--------:|---------------------:|
| dwdx | 22.4MiB | 3413.64 |
| dwdx_colptrs | 2.0KiB | 2.79 |
| dwdx_rowvals | 65.6KiB | 2.66 |
| *combined* | | 3416.79 |
I'd consider this time increase negligible.1 parent 8ead4b0 commit 98c782d
1 file changed
+27
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
2838 | 2839 | | |
2839 | 2840 | | |
2840 | 2841 | | |
2841 | | - | |
2842 | | - | |
2843 | | - | |
2844 | 2842 | | |
2845 | 2843 | | |
2846 | 2844 | | |
| |||
3040 | 3038 | | |
3041 | 3039 | | |
3042 | 3040 | | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
3043 | 3057 | | |
3044 | | - | |
| 3058 | + | |
3045 | 3059 | | |
3046 | 3060 | | |
3047 | 3061 | | |
3048 | 3062 | | |
3049 | 3063 | | |
3050 | 3064 | | |
3051 | 3065 | | |
3052 | | - | |
| 3066 | + | |
3053 | 3067 | | |
3054 | 3068 | | |
3055 | 3069 | | |
| |||
3096 | 3110 | | |
3097 | 3111 | | |
3098 | 3112 | | |
3099 | | - | |
3100 | | - | |
3101 | | - | |
3102 | | - | |
3103 | | - | |
3104 | | - | |
3105 | | - | |
3106 | | - | |
3107 | 3113 | | |
3108 | 3114 | | |
3109 | 3115 | | |
| |||
3137 | 3143 | | |
3138 | 3144 | | |
3139 | 3145 | | |
3140 | | - | |
| 3146 | + | |
| 3147 | + | |
| 3148 | + | |
3141 | 3149 | | |
3142 | | - | |
3143 | | - | |
| 3150 | + | |
3144 | 3151 | | |
3145 | 3152 | | |
3146 | 3153 | | |
3147 | 3154 | | |
3148 | 3155 | | |
3149 | 3156 | | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
3150 | 3160 | | |
3151 | 3161 | | |
3152 | 3162 | | |
| |||
3233 | 3243 | | |
3234 | 3244 | | |
3235 | 3245 | | |
3236 | | - | |
3237 | | - | |
3238 | | - | |
3239 | | - | |
3240 | | - | |
| 3246 | + | |
3241 | 3247 | | |
3242 | 3248 | | |
3243 | 3249 | | |
| |||
0 commit comments