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

Added a simple automata to read member names #47

Merged
merged 3 commits into from Aug 17, 2014

Conversation

Projects
None yet
2 participants
@manofstick
Contributor

manofstick commented Aug 11, 2014

Rather than reading a string and then doing a dictionary lookup we
create a simple automata based on the names of the members, returning
the index of the setter method

Paul Westcott
Added a simple automata to read member names
Rather than reading a string and then doing a dictionary lookup we
create a simple automata based on the names of the members, returning
the index of the setter method
@manofstick

This comment has been minimized.

Show comment
Hide comment
@manofstick

manofstick Aug 11, 2014

Contributor

NB. This still needs to be extended for enums, as well as handling the case of escaped members.

Contributor

manofstick commented Aug 11, 2014

NB. This still needs to be extended for enums, as well as handling the case of escaped members.

Paul Westcott added some commits Aug 14, 2014

Paul Westcott
Fixed NameAutomata to handle escaped characters
I should put a more direct test in; i.e. the one at the moment relies on
turning off UseHashWhenMatchingMembers, but if that internal code was
changed then this isn't a strong guarentee that the Automata code path
is run.
@manofstick

This comment has been minimized.

Show comment
Hide comment
@manofstick

manofstick Aug 15, 2014

Contributor

The handling of escaped characters has been added

Contributor

manofstick commented Aug 15, 2014

The handling of escaped characters has been added

@kevin-montrose kevin-montrose merged commit 3557dc7 into kevin-montrose:master Aug 17, 2014

@kevin-montrose

This comment has been minimized.

Show comment
Hide comment
@kevin-montrose

kevin-montrose Aug 17, 2014

Owner

In testing this appears to be faster than hashing (in addition to being faster than dictionary lookups).

I haven't quite removed all of the hashing code though. It's still used in enum matching (as you've noted) and matching anonymous member names.

Anonymous types are a little fun since we have to create them via their constructor, rather than setting the properties after using the default constructor.

Removing the rest of hashing would be a good follow up PR.

Owner

kevin-montrose commented Aug 17, 2014

In testing this appears to be faster than hashing (in addition to being faster than dictionary lookups).

I haven't quite removed all of the hashing code though. It's still used in enum matching (as you've noted) and matching anonymous member names.

Anonymous types are a little fun since we have to create them via their constructor, rather than setting the properties after using the default constructor.

Removing the rest of hashing would be a good follow up PR.

@manofstick manofstick deleted the manofstick:string-automata branch Aug 18, 2014

manofstick pushed a commit to manofstick/Jil that referenced this pull request Aug 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment