Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve float serialization, add .NET 5 Half support. #77

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Nov 21, 2020

  1. Target netcoreapp3.1 instead of netcoreapp3.0

    .NET Core 3.0 is unsupported now and targeting it actively throws a warning on the .NET 5 SDK.
    PJB3005 committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    19c22ba View commit details
    Browse the repository at this point in the history
  2. Add .NET 5 support.

    For future commit to add Half support.
    PJB3005 committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    253923c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b7afbfb View commit details
    Browse the repository at this point in the history
  4. Improve float serialization.

    Float serialization used the same serialization code as normal integers, which writes less bytes if the integer is of sufficiently small size. The problem however is that a float is basically *never* so small due to how the bits are laid out and this almost always resulted in a wasted extra byte vs just writing the 4/8 bytes of the float directly.
    
    ("basically never" is everything except 0/subnormals, which I'd say is not worth adding an extra byte to almost all other floats over. I even tested all possible floats just to make sure.)
    
    The new code is also faster on Core because it writes the 4/8 bytes at once instead of individual WriteByte/ReadByte() calls (see benchmarks in PR).
    PJB3005 committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    646e77b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    915c8de View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2020

  1. Fix indentation.

    PJB3005 committed Nov 27, 2020
    Configuration menu
    Copy the full SHA
    701fbdc View commit details
    Browse the repository at this point in the history