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

Simplify ShapeDescriptorIndex #15632

Merged
merged 12 commits into from
Apr 3, 2024
Merged

Simplify ShapeDescriptorIndex #15632

merged 12 commits into from
Apr 3, 2024

Conversation

MikeAlhayek
Copy link
Member

@MikeAlhayek MikeAlhayek commented Mar 30, 2024

@sebastienros I think this can slightly help since you are working on #15620

This PR provide a slightly better improvement in the time it takes to create these object and the allocated memory. Here is a benchmark.

image

@sebastienros
Copy link
Member

I think this change doesn't matter at all.

@MikeAlhayek
Copy link
Member Author

I think this change doesn't matter at all.

@sebastienros are you talking about ToList() to ToArray() original change? It would just save very minor memory for each tenant.

But in the latest commit, reduces the iteration during each tenant's first request.

@MikeAlhayek MikeAlhayek requested a review from Piedone April 1, 2024 17:17
@sebastienros sebastienros changed the title Use Array instead of List in ShapeDescriptorIndex Simplify ShapeDescriptorIndex Apr 2, 2024
Copy link
Member

Choose a reason for hiding this comment

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

The benchmark code look useful as well, please re-add it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sebastienros requested to remove it :)

Copy link
Member

Choose a reason for hiding this comment

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

Sebastien is wrong :D. But really, that version of the code that works with the current service (obviously you can't have comparison benchmarks between the different versions since we won't keep those) is useful both for future benchmarking, and as a sample code for benchmarks.

Copy link
Member

@sebastienros sebastienros Apr 3, 2024

Choose a reason for hiding this comment

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

I highly doubt anyone will run this benchmark again. Data is known now. It's not one that ensures we don't regress some related component but one that compares two implementations. What I know though is that each and every build of OC would now have to build it too. If people really care they will look at the history of the code, find this PR and do another benchmark.

Copy link
Member

Choose a reason for hiding this comment

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

Why do we have the other benchmarks in OrchardCore.Benchmarks, then?

I'd put a premium on developer productivity, what having such benchmarks with best practices in the code base provides, rather than the perhaps immeasurable impact of this class having on build time (which you only pay once without changing it anyway). It shows that we benchmarked this class, and any future changes, which will definitely come with .NET upgrades, can be benchmarked again. Nobody will look into PR histories (since with squash merging it won't even be in the repo history) for inspiration.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sebastienros I think what @Piedone is saying that way this benchmark was written can be a good example to keep in the benchmark as a code reference. None of the benchmarks show how we can setup a shell and run benchmarks against that shell. The value is in keeping the code sample not the benchmark result. Is that what you are suggesting here Zoltan?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but as mentioned, apart from a sample, it'll also be useful for future benchmarking as-is.

@MikeAlhayek MikeAlhayek merged commit 74d923c into main Apr 3, 2024
5 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/ShapeDescriptorIndex branch April 3, 2024 19:43
@Piedone
Copy link
Member

Piedone commented Apr 3, 2024

Why did you merge this, Mike? It wasn't approved yet.

@MikeAlhayek
Copy link
Member Author

Spoke to @sebastienros and he is good with the benchmark being there. Also, he needs it as he is working on #15651

@Piedone
Copy link
Member

Piedone commented Apr 3, 2024

That's great, but since I've been reviewing this PR, I'd have appreciated not merging before my approval. Not for bureaucracy, but for reviewing code changes since then.

@MikeAlhayek
Copy link
Member Author

I understand. Sorry I thought you were good with it since the last thing you had was to bring back that BM. Let me know if you need changes, I can submit a follow up PR

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