Comments (8)
@gambhiro that doesn't seem like a fair comparison because you are not including any of the other dependencies.
On my computer a build following cargo clean
takes 68 seconds without serde_codegen and 115 seconds with serde_codegen, but subsequent builds take 9 seconds either way. When iterating you only care about the 9 second time which is the same for both.
from mdbook.
serde
is super nice when used in the nightly branch because you can simply mark your structs as #[derive(Serialize)]
or #[derive(Deserialize)]
and then encode/decode them to any format supported by serde (I used JSON, but I hear YAML is being worked on too). It worked perfectly!
The downside is you're limited to the nightly branch. serde
can be used on stable, but you end up implementing those traits yourself (which isn't too hard, but it is work).
Beyond that, I don't have a lot of knowledge about the differences :\
from mdbook.
Ok thanks for the clarification!
I will probably wait until all the features are in stable then, and focus on the other things in the meantime.
from mdbook.
Just for reference, this is waiting for rust-lang/rust/issues/29597 and rust-lang/rust/issues/29644 to land in stable.
from mdbook.
I think it would be OK to make the jump now. Serde is becoming the defacto serialiser / deserialiser even though some ergonomic features are only available on nightly.
I think there are 2 ways we can make it work:
- Using serde_codegen
- Manual implementation
Code gen is obviously more convenient but requires some extra work in the build script. Which is not a big deal.
from mdbook.
I followed the serde readme and made an experiment in this branch, refactoring only bookconfig.rs
.
Although it works, the build time has become quite long, 1.5 mins instead of 9 secs.
With codegen:
cargo build 86.78s user 0.57s system 99% cpu 1:27.37 total
while before:
cargo build 8.93s user 0.37s system 99% cpu 9.327 total
I didn't PR because I think it's not worth the long feedback time while working. The feature tickets are apparently being worked on, I suggest waiting until they arrive in the stable release.
from mdbook.
That is a reasonable choice, thanks for looking into it :)
from mdbook.
@dtolnay Thanks for explaining. I'm quite new to the rust build tools.
from mdbook.
Related Issues (20)
- Verify all Markdown files are linked from SUMMARY.md (or from somewhere else) HOT 1
- Syntax Highlighting for "JSON with Comments" a.k.a. jsonc HOT 1
- Request for Support of .NET 8.0 Features Including Primary Constructors and File-Scoped Namespaces HOT 1
- Bug: separator gets folded by subsection HOT 4
- how to .. localization ? HOT 1
- Summary can't deal with fragments, `#id` style deep links HOT 1
- Advanced features when including files
- markdown > syntax cannot wrap HOT 1
- Links with empty path cause error
- How to prevent the .git directory in the output directory from being deleted? HOT 2
- Let all the output html files share the same one sidebar HOT 6
- Accessibility: New Markdown files must start with Heading Level 2 because Book Title is Heading level 1 HOT 4
- Support '/' shortcut to search
- Images with relative path not displayed on index.html HOT 1
- Figure out a strategy for updating public dependencies HOT 1
- 0.4.38 release has no assets HOT 2
- Is there a way to use own markdown short code templates? HOT 2
- Non-English search support HOT 5
- Replace icon fonts with SVG HOT 1
- Use capital letters to indicate the default value in (y/n) prompts
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 mdbook.