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

Shrink SubmissionResponse #253

Merged
merged 1 commit into from
Apr 18, 2021

Conversation

benaadams
Copy link
Contributor

Inspecting with ObjectLayoutInspector TypeLayout.PrintLayout<SubmissionResponse>()

Pre

Type layout for 'SubmissionResponse'
Size: 32 bytes. Paddings: 5 bytes (%15 of empty space)
|================================================================|
| Object Header (8 bytes)                                        |
|----------------------------------------------------------------|
| Method Table Ptr (8 bytes)                                     |
|================================================================|
|   0-7: String <Message>k__BackingField (8 bytes)               |
|----------------------------------------------------------------|
|  8-15: Exception <Exception>k__BackingField (8 bytes)          |
|----------------------------------------------------------------|
| 16-19: Int32 <StatusCode>k__BackingField (4 bytes)             |
|----------------------------------------------------------------|
|    20: Boolean <Success>k__BackingField (1 byte)               |
|----------------------------------------------------------------|
|    21: Boolean <BadRequest>k__BackingField (1 byte)            |
|----------------------------------------------------------------|
|    22: Boolean <ServiceUnavailable>k__BackingField (1 byte)    |
|----------------------------------------------------------------|
|    23: Boolean <PaymentRequired>k__BackingField (1 byte)       |
|----------------------------------------------------------------|
|    24: Boolean <UnableToAuthenticate>k__BackingField (1 byte)  |
|----------------------------------------------------------------|
|    25: Boolean <NotFound>k__BackingField (1 byte)              |
|----------------------------------------------------------------|
|    26: Boolean <RequestEntityTooLarge>k__BackingField (1 byte) |
|----------------------------------------------------------------|
| 27-31: padding (5 bytes)                                       |
|================================================================|

Post

Type layout for 'SubmissionResponse'
Size: 24 bytes. Paddings: 4 bytes (%16 of empty space)
|=======================================================|
| Object Header (8 bytes)                               |
|-------------------------------------------------------|
| Method Table Ptr (8 bytes)                            |
|=======================================================|
|   0-7: String <Message>k__BackingField (8 bytes)      |
|-------------------------------------------------------|
|  8-15: Exception <Exception>k__BackingField (8 bytes) |
|-------------------------------------------------------|
| 16-19: Int32 <StatusCode>k__BackingField (4 bytes)    |
|-------------------------------------------------------|
| 20-23: padding (4 bytes)                              |
|=======================================================|

@@ -3,31 +3,26 @@

namespace Exceptionless.Submission {
public class SubmissionResponse {
internal static readonly SubmissionResponse Ok200 = new(200, "Ok");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for a followup PR

@benaadams benaadams force-pushed the SubmissionResponse branch from f338d8a to 061f4e2 Compare April 18, 2021 00:00
@ejsmith
Copy link
Member

ejsmith commented Apr 18, 2021

Oh wow... that's pretty interesting. Thanks!

Copy link
Member

@ejsmith ejsmith left a comment

Choose a reason for hiding this comment

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

LGTM

@ejsmith ejsmith merged commit b81c79e into exceptionless:master Apr 18, 2021
@benaadams benaadams deleted the SubmissionResponse branch April 18, 2021 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants