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

Extract hex digits cache regex #3140

Merged
merged 8 commits into from
Nov 20, 2021
Merged

Conversation

David-Moreira
Copy link
Contributor

@David-Moreira David-Moreira commented Nov 18, 2021

Closes #3133

Didn't have time to finish yet.
Need to test Regex.Matches vs our version as I am not 100% it's 100% logically equivalent. If it is, then it's way faster.

image

Also need to do some reading up on https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices as static method Regex.IsMatch might also be worth considering...
Edit: I'm not sure if additional steps need to be taken to actually take advantage of RegexOptions.Compiled ?

Also consider using Span in the future to do internal optimizations in string manipulation... might be worth it for 1.0.0
A good resource:
https://www.youtube.com/watch?v=FM5dpxJMULY&ab_channel=NickChapsas

@David-Moreira David-Moreira requested a review from stsrki November 20, 2021 14:39
Copy link
Collaborator

@stsrki stsrki left a comment

Choose a reason for hiding this comment

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

LGTM

When changing the theme it feels faster now. Maybe it is subjective I don't know.

Regarding the use of Span. I thought so too already, but I don't have a clear use-case for it. If you want to make use of it just create a new ticket for later,

@stsrki stsrki merged commit e1b9242 into rel-0.9.5 Nov 20, 2021
@stsrki stsrki deleted the rel-0.9.5-ExtractHexDigits-CacheRegex branch November 20, 2021 21:03
@David-Moreira
Copy link
Contributor Author

I felt like it was faster too haha but I didn't bother to go compare both versions side by side haha.
We'll eventually figure out some ways to benchmark the full rendering of the pages so we can have tangible numbers.

I think every internal string manipulation can use it. You have some substringing in the theme generator for example. It should be a bit faster and without allocations, we'll do it once we clear up out the big stuff in the release.

stsrki added a commit that referenced this pull request Nov 25, 2021
* Extract hex digits cache regex (#3140)

* Start With Benchmark

* Add ThemeGenerator for baseline benchmark

* ExtractHexDigits cache REGEX

* Methods Benchmarked + Tests

* Theme Generator : Refactor ExtractHexDigits

* Add test making sure ThemeGenerator is still logically equivalent to previous version.

* Run format

* Rename IsHexDigit

Co-authored-by: Mladen Macanovic <[email protected]>

* Fix Table THead Query Selector to target only first THead for FixedHeader and Resize features. (#3155)

* Support types without object equal operator ( extend test for DateTime, TimeSpan ) (#3152)

* Add test for DateTime and TimeSpan

~ set CultureInfo on test start
+ add test for DateTime
+ add test for TimeSpan

* Value type comparison

+ implement value type handling for expression compare
~ fix timespan test to use correct expecting values

* add more test & simplify

+ add more corner test
~ replace activator with expression default
~ replace member.reflectedtype with item.type

* Fix typos in docs (#3164)

* Mark snackbarInfos as readonly

* Fix unused snackbar title parameter

* Override ReleaseResources

* Fix missing comment param

Co-authored-by: David <[email protected]>
Co-authored-by: puschie286 <[email protected]>
stsrki added a commit that referenced this pull request Dec 8, 2021
* Unused vars (#3165)

* Extract hex digits cache regex (#3140)

* Start With Benchmark

* Add ThemeGenerator for baseline benchmark

* ExtractHexDigits cache REGEX

* Methods Benchmarked + Tests

* Theme Generator : Refactor ExtractHexDigits

* Add test making sure ThemeGenerator is still logically equivalent to previous version.

* Run format

* Rename IsHexDigit

Co-authored-by: Mladen Macanovic <[email protected]>

* Fix Table THead Query Selector to target only first THead for FixedHeader and Resize features. (#3155)

* Support types without object equal operator ( extend test for DateTime, TimeSpan ) (#3152)

* Add test for DateTime and TimeSpan

~ set CultureInfo on test start
+ add test for DateTime
+ add test for TimeSpan

* Value type comparison

+ implement value type handling for expression compare
~ fix timespan test to use correct expecting values

* add more test & simplify

+ add more corner test
~ replace activator with expression default
~ replace member.reflectedtype with item.type

* Fix typos in docs (#3164)

* Mark snackbarInfos as readonly

* Fix unused snackbar title parameter

* Override ReleaseResources

* Fix missing comment param

Co-authored-by: David <[email protected]>
Co-authored-by: puschie286 <[email protected]>

* Revert "Unused vars (#3165)" (#3167)

This reverts commit 13c9004.

* added czech translations for components

Added czech tranlations for data grid , file edit , time picker and date picker components

* Added translations for carousel and color picker

Added czech translations for carousel and color picker

Co-authored-by: Mladen Macanović <[email protected]>
Co-authored-by: David <[email protected]>
Co-authored-by: puschie286 <[email protected]>
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