Skip to content

ATS: performance updates - #322

Merged
natemcmaster merged 3 commits into
dotnet:AzureTableStoragefrom
natemcmaster:ats-perf
Jun 17, 2014
Merged

ATS: performance updates#322
natemcmaster merged 3 commits into
dotnet:AzureTableStoragefrom
natemcmaster:ats-perf

Conversation

@natemcmaster

Copy link
Copy Markdown
Contributor

Includes some renaming and whitespace changes.

Notable changes:
TableEntityFactory - uses thread-safe caching and no longer uses the slow .Invoke() method for instance construction.
TableFilter - refactored so it no longer uses reflection
Namespace changes - moved extensions to the namespace they are extending-->Should light up in Intellisense

Also, adds more detailed tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This good because it creates a compiled delegate to create instances. I'm fine with it staying like this for now, and possibly for always. However, it is possible that for project-n the delegate created will be interpreted rather than truly compiled. This is one of the reasons we are avoiding creating "compiled" delegates where possible. Take a look at SimpleEntityKeyFactory and related classes. In these classes we avoid having to compile any dynamic code by creating a generic type for the factory using Reflection, creating one instance of this factory, then caching the factory instance such that it can be used over and over to create SimpleEntityKey instances without Reflection and without using any "compiled" delegates. All that being said, I am fine with leaving this code as is for now, especially since it is for ATS which does not currently intersect with project-n.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I talked to Arthur about this. I think it is worth having a TODO to consider doing what he described later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed. For now, I'm intentionally not caching instances to avoid storing an adapter for every entity in the table. This would be faster on the CPU in some cases, but worse for memory in others. These issues can be mitigated by limiting the cache size or using a different method of generic type construction. I'll add a TODO to investigate these options and their performance gains.

@ajcvickers

Copy link
Copy Markdown
Contributor

:shipit:

@natemcmaster
natemcmaster merged commit f74207f into dotnet:AzureTableStorage Jun 17, 2014
@natemcmaster
natemcmaster deleted the ats-perf branch June 17, 2014 21:15
Copilot AI added a commit that referenced this pull request May 23, 2026
…iting emulator issues #322 and #319; remove diagnostic md files

Agent-Logs-Url: https://github.com/dotnet/efcore/sessions/773a262b-df07-464f-9364-92c079d190c7

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
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.

3 participants