Skip to content

gd options and other (check desc) #29

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

Merged
merged 7 commits into from
Oct 7, 2023
Merged

Conversation

flightlex
Copy link
Contributor

added EVERY gd option (in the options page)

&& in-game resolutions
&& in-game LDM (Low Detail Mode)
&& Vertical Sync Check
&& Smooth Fix Check
&& PlayerGlow

added EVERY gd option (in the options page)
&& in-game resolutions
&& in-game LDM (Low Detail Mode)
&& Vertical Sync Check
&& Smooth Fix Check
&& PlayerGlow
DataPlist = new Plist(Encoding.ASCII.GetBytes(resultPlist));
}
var xor = Crypt.XOR(data, 0xB);
var index = xor.GetIndexOfNullByte();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be implemented easier and will be even faster

xor.AsSpan().IndexOf((byte)0)

Because inside IndexOf use a simd instructions.

Proof:

using System;
using System.Linq;
using BenchmarkDotNet.Attributes;

namespace GeometryDashAPI.Benchmarks.Benchmarks;

[MemoryDiagnoser]
public class IndexOfBenchmark
{
    private static readonly byte[] data = Enumerable.Range(0, 4096)
        .Select(x => (byte)(1 + (byte)(x % 250)))
        .Concat(new byte[] { 0 })
        .ToArray();

    [Benchmark]
    public int IndexOf() => data.AsSpan().IndexOf((byte)0);

    [Benchmark]
    public int GetIndexOfNullByte() => data.GetIndexOfNullByte();
}
Method Mean Error StdDev Allocated
IndexOf 84.86 ns 1.939 ns 5.657 ns -
GetIndexOfNullByte 2,244.83 ns 38.261 ns 35.789 ns -

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh..

@Folleach Folleach merged commit 21ed109 into Folleach:master Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants