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

Fix logic in #3155 #3156

Merged
merged 2 commits into from
Oct 25, 2024
Merged

Fix logic in #3155 #3156

merged 2 commits into from
Oct 25, 2024

Conversation

Denneisk
Copy link
Member

Misread ^ as a sound character... also replaced to string.find since match isn't needed here.

@thegrb93 thegrb93 merged commit c95c4c6 into wiremod:master Oct 25, 2024
1 check failed
@Denneisk
Copy link
Member Author

Isn't the point to not have to create a substring? :P

@thegrb93
Copy link
Contributor

thegrb93 commented Oct 25, 2024

I think find does too, unless it only does if there's captures. Oh well its one or two characters vs 2 numbers. I prefer less change over a nanooptimization

@Denneisk
Copy link
Member Author

Only if there's capture groups. I did simple benchmarks on every possible case and the stats were confusing like every other benchmark I do.

Benchmark
; x = no match characters
; a = first character match
; b = second character match
reps	100	rounds	10000
find  single x	1.2611629776075e-07
match single x	1.1761829943134e-07
find  double x	1.4952769875526e-07
match double x	1.3584789953165e-07
find  single a	1.2237459917378e-07
match single a	1.6627609646093e-07
find  double b	1.4881190057349e-07
match double b	1.7954319829005e-07

@thegrb93
Copy link
Contributor

Because you'll get more variance from cache misses or branch prediction than the actual code or algorithm

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