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

Overhauled allocations documentation for helpfulness #643

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

RobinBateman808
Copy link
Collaborator

@RobinBateman808 RobinBateman808 commented Apr 18, 2024

Motivation:

Edited documentation to improve helpfulness for new and experienced Swift on Server (SOS) users.

Modifications:

Added definitions and explanations where needed, edited existing content for clarity, and formatted for scannability.

Result:

Increase user adoption and bolster the SOS community.

@kaishin
Copy link
Collaborator

kaishin commented Apr 21, 2024

@0xTim

Copy link
Collaborator

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

Thanks for this! See comments

documentation/server/guides/allocations.md Outdated Show resolved Hide resolved
documentation/server/guides/allocations.md Outdated Show resolved Hide resolved
documentation/server/guides/allocations.md Outdated Show resolved Hide resolved
documentation/server/guides/allocations.md Outdated Show resolved Hide resolved
documentation/server/guides/allocations.md Show resolved Hide resolved
@RobinBateman808
Copy link
Collaborator Author

@0xTim - made changes as suggested and corrected code formatting.

Copy link
Collaborator

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

Almost there! Few last changes


```swift
An example program using AsyncHTTPClient can be written as:
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing language on the code block, re-add

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@0xTim - Thanks for the review. I'm not sure what's happening with the code. I'm not making any changes to the blocks or text unless it was something you previously caught. Any suggestions or insight would be appreciated. :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adjusted space before code blocks. Preview of text renders language in code block.
image


```bash
In this instance, a user probe was installed for all allocation functions because Swift uses other functions like `calloc` and `posix_memalign`.
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing language in the code block

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adjusted space before code blocks. The text renders as it should.
image

documentation/server/guides/allocations.md Outdated Show resolved Hide resolved
documentation/server/guides/allocations.md Outdated Show resolved Hide resolved
documentation/server/guides/allocations.md Show resolved Hide resolved
On Apple platforms, Swift uses a slightly larger number of allocation functions than Linux. Therefore, specifying a few more functions is required.

Once the data is collected, run this command to create an SVG file:
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Language

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what you mean here. But removed "Therefore, specifying a few more functions is required." to mitigate confusion.

perf script | \
/FlameGraph/stackcollapse-perf.pl - | \
swift demangle --simplified | \
/FlameGraph/flamegraph.pl --countname allocations \
--width 1600 > out.svg
--width 1600 > out.svg
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still missing the indentation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added indent again. Hoping it "sticks" this time.

image

RobinBateman808 and others added 5 commits May 23, 2024 11:00
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
@RobinBateman808
Copy link
Collaborator Author

@0xTim - Hopefully, the latest changes will fix things. Thanks for your time and patience! :-)

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.

None yet

3 participants