Skip to content

Documentation issues #320

Closed
Closed
@gnzlbg

Description

@gnzlbg

I was going through the documentation and found out the following minor issues:

  • The features say:

Two APIs: faster concatenation-based write API and slower (but still very fast) replacement-based format API with positional arguments for localization.

But the docs do not mention much more about this. There is a link to a benchmark page but in my opinion the documentation should make it very explicit which API to use to get the fastest code (the documentation of the writer API should say this), and the documentation of the slower API (the format API) should have disclaimers that indicate that, while possibly nicer/more convenient, that API is slower.

  • More examples for the format API: I missed examples of formatting floating point numbers using the format API (there is no single example that uses all the options available {:+03.2f}. ).
  • It would be nice if for each syntax option like f or g or e the syntax page would show, next to the option, how a particular floating point number would get formatted out. That is, it would be nice to have one or two examples of "number + syntax + result" next to each option. It would be nice if the examples would range for simple {:e} to more complicated involving also +/-, precision, positional arguments, corner cases (inf, nan). For example there is a situation where it is explained how to translate from C fprintf syntax to fmt syntax. While this is nice, I actually had to google what the C fprintf syntax actually meant.
  • I wanted to format floating point numbers as fast as possible and wanted to use the writer API for this but there are no comprehensive examples about how to use the writer API to format floating point numbers as fast as possible.
  • Is it posible to reserve the size of a BasicMemoryWriter? I thought this would be very important for performance but it doesn't seem to be possible.

These are just nitpicks, all the information is there, but the docs make me in my opinion invest too much effort into putting it all together. Complicated examples that make use of all the features would really help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions