Comments (5)
If you're using Array.Parallel
, as a first check I'd make sure that you have server GC configured. The easiest way is by setting an environment variable, see here. Server GC can substantially speed up parallel calculations, and this is not specific to fsdocs.
What outputs are you generating? If you are generating .html, .fsx, and .ipynb outputs then fsdocs will run the code 3 times. That could be part of your issue.
More generally, can you cache the chart, rather than building it each time? You could include a cached chart using regular markdown
(***do-not-eval***)
// This code will show up but it will not be evaluated
Array.Parallel.mapi veryLongFunction
(**
Some markdown text
![myChart](path-to-images/cachedChart.png)
*)
As an aside, Array.Parrallel is parallel but not Asynchronous. Async typically refers to async expressions.
from fsharp.formatting.
If you're using
Array.Parallel
, as a first check I'd make sure that you have server GC configured. The easiest way is by setting an environment variable, see here. Server GC can substantially speed up parallel calculations, and this is not specific to fsdocs.
I didn't know much about this, that's interesting.
What outputs are you generating? If you are generating .html, .fsx, and .ipynb outputs then fsdocs will run the code 3 times. That could be part of your issue.
The output is generated from an .fsx file yes. This partly explains the slowdown, as running it 3 times would cause around 3.5 hours of build time. The remaining hour or so might be caused by garbage collection or some other factors.
Why does fsdocs run .fsx files three times though? I might have missed it but I don't think I have seen this mentioned anywhere.
More generally, can you cache the chart, rather than building it each time? You could include a cached chart using regular markdown
This is what I have in mind, in case I cannot find a proper fix.
Thank you for the quick reply.
from fsharp.formatting.
Why does fsdocs run .fsx files three times though?
If you're only generating .html (the default, what it sounds like you're doing), it will run once. But fsdocs allows creating multiple outputs from a .fsx script, and it'll run once per output type. See e.g. the _template.ipynb
references here.
That's how the files backing the "download in notebook" link are generated on this site's docs page, such as at the top of the creating content page I just linked to.
from fsharp.formatting.
If you're only generating .html (the default, what it sounds like you're doing), it will run once. But fsdocs allows creating multiple outputs from a .fsx script, and it'll run once per output type. See e.g. the
_template.ipynb
references here.
Right, I thought it was running it three times for other reasons. As you guessed I'm only getting an html output. Then it's still very strange to me that this function takes 4-5 times as much time only when I'm calling it from fsdocs.
from fsharp.formatting.
Setting the server GC actually brought the build time down to the expected duration. Thank you for the help @nhirschey.
from fsharp.formatting.
Related Issues (20)
- Get CommonMark 0.30 tests to pass for "Tabs" section
- Get CommonMark 0.30 tests to pass for "Fenced code blocks" section
- Dockerfile fails to build with "failed to solve: process /bin/bash ..." HOT 2
- discussion: multi target F# libraries (IL, WebSharper, Fable, etc.)
- discussion: offering back links form API pages to the other documentation pages?
- Need to update repo's nuget API key HOT 2
- Package references cannot be resolved when trying to build API documentation programmatically HOT 4
- Modernize the default theme HOT 37
- Some displayed examples may have broken indendation HOT 11
- Add how-to for the most typical scenario HOT 2
- List users of this tool HOT 1
- CSharp library not used for generating API docs HOT 7
- Function signature tooltips include attributes for arguments that make the tooltip unreadable HOT 5
- Directory.Build.props is ignored if there are no projects or solutions HOT 3
- SEO-optimization for new theme HOT 4
- Suggestion: init command
- Dark mode borders: too much contrast?
- Namespace description overflows content box
- Output font size on mobile safari is too big HOT 6
- Using testcontainers in a fsx script gives wrong output HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsharp.formatting.