# Tag Info

### How to compile effectively?

Leonid Shifrin has already given an excellent answer for the question but it's so… long and may be frustrating for someone just beginning to learn the usage of ...
• 54.2k
Accepted

### Has this implementation of FDM touched the speed limit of Mathematica?

Okay, this is a bit of an embarassment. Here is a very small modification of the original code. I simply made explicit option settings, made a denominator to Sin ...

### Strange behavior of Table

This is because Table automatically compiles its argument above a certain length limit. ...
• 227k
Accepted

### Use Compile to improve performance

First off, your function is very simple without any hard number-crunching, so it will always be hard to get a large speedup for the compiled version. Secondly, your ...
• 111k

### What does Compile[] do to make code run so much faster?

One of the biggest differences between main kernel evaluation and compiled evaluation in the "Wolfram Virtual Machine" (WVM) is that in the kernel, arbitrary expressions are allowed that are ...
• 220k
Accepted

### Sudden increase in timing when summing over 250 entries

The default SumCompileLength is 250. You can increase this number for example to 500 using ...
• 27.1k

### Why can Mathematica not use the compiled code?

It is important to Compile that it has always the same return type, no matter what happens at runtime. Note that Which returns <...
• 96.3k
Accepted

### Save a C compiled function without losing the blessing of C compiler

Yes, there is! Mathematica creates a LibraryFunction when compiling to C, but puts it in a temporary directory. If you can recover the library, you can load it as ...
• 8,628

### Which Distributions can be Compiled using RandomVariate

Another option to the answer posted by Andy Ross cropped up in a recent question of mine about corrupting an image with Poisson noise. In my own answer, I made use of ...
• 8,628
Accepted

### Is there any strategy to have a compiled version of FindFit or NonlinearModelFit?

No, it is not possible. With code converted to a LibraryLink library by way of Compile you are limited to using functions that either can be expressed directly in ...
• 22.6k

### Why is CompilationTarget -> C slower than directly writing with C?

Using Compile with CompilationTarget->"C" does generate C-Code to be compiled in a generalized way, the resulting code will ...
• 23.1k
Accepted

### Writing compiled functions as fast as Python's Numba

Based on the experience obtained here: ...
• 54.2k

### What does Compile[] do to make code run so much faster?

Extended comment.. I've never come across specifics of what Compile[] specifically does. That said, a definition re: programming languages in general provides some ...
• 13.8k

### Compilation of Total with compensated summation

Compilation of Total As pointed out in a comment, it seems that the compensated summation form of Total can't be compiled. You can check this using ...
• 8,628

### Why is this compiled function 50x slower?

Here is the original code. logisticMap[x0_, μ_, n_] := Module[{i}, RecurrenceTable[{x[i + 1] == μ x[i] (1 - x[i]), x[1] == x0}, x, {i, 1, n}]] We'll ...

### Substitute for Association inside Compile?

For what it's worth, you can work with a HashTable as long as you're willing to put in a bit of effort ...
• 45.6k
Accepted

### Performance regression for Fold?

The reason for this behavior is that autocompilation always uses settings equivalent to "RuntimeOptions" -> {"Quality", "WarningMessages" -> False}. As ...
• 25.1k
Accepted

### CompiledFunctionCall vs. LibraryFunction

It appears that LibraryFunction occurs if the function being called inside the other compiled function is a function that has been compiled to C, provided this ...
Accepted

### Is it possible for LibraryLink function to be Listable like that in Compile?

Simple solution There is an easier solution than the one I gave almost 2 years ago. In principle, you wrap your library function inside another CompiledFunction ...
• 111k

### Compile with a list as an argument

I think this is because a in your code represents a rank 10 tensor. If you want to use a as a vector, then I think it would be ...
• 26.9k
Accepted

### Implementing a compilable Faddeeva function of complex argument

Preface I've put a FaddeevaM package on my GitHub account that will do all that follows automatically. It is a full package that exposes all (and not only the Faddeeva $w$) functions for Mathematica ...
• 111k
Accepted

### Why can't I inject expressions in Compile using (only) With

Compile is considered a scoping construct by the outer With, and its bindings are protected. This will work: ...
• 112k
Accepted

### How to use CompilerOptions?

These are accepted as valid rules for CompilerOptions -> { rules }: ...
• 220k
Accepted

### LLVM compilation in version 12.3

No expert on this, but will share what little I know about this. This is based on my understanding of the video Wolfram Language Version 12.3 Sneak Peek with Jon McLoone Here is a link What ...
• 112k

### How to convert the ListVector into PackedArray in FunctionCompile

Edit Regarding the direct question in OP, i.e. how to flatten a "ragged" array inside FunctionCompile, I have to say there might be ready-to-use method ...
• 26.6k