Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: StringEpsilon/PhpSerializerNET
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: StringEpsilon/PhpSerializerNET
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ReworkTokenizer
Choose a head ref
  • 11 commits
  • 64 files changed
  • 1 contributor

Commits on Jul 22, 2024

  1. Split the tokenizer into a validator and tokenizer.

    The main benefit is reduced memory allocations, as we now count the tokens during the validation step and then work off of a flat array without nesting children.
    
    I have also slightly loosened the coupling between tokenizer and deserializer.
    
    Lastly there has been some housekeeping with naming and file locations.
    StringEpsilon committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    d601072 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1792a1e View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2024

  1. Configuration menu
    Copy the full SHA
    2de1f7a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2f3a72a View commit details
    Browse the repository at this point in the history
  3. Deserializer: Initialize collection types with proper length.

    Saves some time and allocation.
    StringEpsilon committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    f3ddadd View commit details
    Browse the repository at this point in the history
  4. Update changelog

    StringEpsilon committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    c744a13 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2024

  1. Configuration menu
    Copy the full SHA
    f384f55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1a6cb96 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. Deserialization: Some more performance improvements.

    - Do not get the PhpDataType and switch on that, intead directly switch on the relevant input byte.
    - In the validator: Increment the token count only in the array and object methods.
    - Tokenizer: Add AggressiveOptimization hint to GetToken().
    StringEpsilon committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    64e67a8 View commit details
    Browse the repository at this point in the history
  2. Performance: Do the input re-encoding faster.

    Also: For small inputs, we can stackalloc the byte array.
    
    Updated changelog to reflect the performance status.
    StringEpsilon committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    5e6032e View commit details
    Browse the repository at this point in the history
  3. Performance: Don't copy the input bytes as string to the PhpToken.

    This reduces memory allocation for doubles, bools and floats, as they can be directly evaluated from the raw bytestream.  That also speeds up deserialization by a lot.
    
    We also no longer have to give the Tokenizer the input encoding.
    
    There are probably some further optimizations to be had in the deserializer -> DeserializeTokenFromSimpleType() method too.
    StringEpsilon committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    f7ea9cd View commit details
    Browse the repository at this point in the history
Loading