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

go performance refactoring learnings #126

Merged
merged 19 commits into from
Oct 16, 2023
Merged

Conversation

lainio
Copy link
Contributor

@lainio lainio commented Oct 4, 2023

  • fix links to previous blog post
  • first draft
  • better intro
  • first draft
  • part 1 language fixing
  • review ready
  • cover image
  • release date

@lainio lainio requested a review from lauravuo October 4, 2023 20:19
@github-actions github-actions bot added the dev label Oct 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

PR created by lainio

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

PR created by lainio

Copy link
Contributor

@lauravuo lauravuo left a comment

Choose a reason for hiding this comment

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

Great text and really interesting topic(s)!

The usual comment: I would divide the text in two posts 😄 One for performance and other for readability and cross-reference to the other text when needed.

I added some comments where I think additional clarifications are needed.

Let's sync more online.

PS. Is the new PGO-feature https://go.dev/doc/pgo at all related or could it be commented in the text somehow

---

Since jumping on the OSS (Open Source Software) wagon, I have been learning
new things about software development and getting more proof to do something in
Copy link
Contributor

Choose a reason for hiding this comment

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

"getting more proof to do something in specific ways" is a bit hard to grasp

attributes](https://en.wikipedia.org/wiki/List_of_system_quality_attributes)
during programming. They say you shouldn't sacrifice, for instance, readability
or maintainability for performance. You can write more readable code when you
know how compilers and underlying hardware work and execute **multi-discipline
Copy link
Contributor

Choose a reason for hiding this comment

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

what are these multi-disclipline engineering practices? is it explained earlier or in some of the chapters?

title: "Image #:counter"
---

Since jumping on the OSS (Open Source Software) wagon, I have been learning
Copy link
Contributor

Choose a reason for hiding this comment

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

The introduction is quite long. Think about the reader, what motivates him to read further? What there is to be gained by reading this blog?

achieved **cross-domain engineering practices**.

In this post, I'll go through some fundamental Go tools and tricks you could use
to achieve *decent execution speed of your (Go) software and maintain or
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels you are trying to cover both readability and performance in this text. It feels like the topics would deserve a dedicated blog each.

to achieve *decent execution speed of your (Go) software and maintain or
increase its readability.*

# Perfect Code?
Copy link
Contributor

Choose a reason for hiding this comment

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

This chapter would be an excellent intro for the perf blog.

Expressing things with the control-flow structures of imperative (or functional)
programming languages is more challenging – especially when the correctness of
the design should be verified. It seems that it’s easy to forget software
quality attributes during fast-phasing programming if we use tools that only
Copy link
Contributor

Choose a reason for hiding this comment

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

phasing -> phased


The `-benchmem` flag inserts two columns to benchmarking results:

```
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a bit confusing that the sources for these functions are shown only after this chapter.

Since jumping on the OSS (Open Source Software) wagon, I have been learning
new things about software development and getting more proof to do something in
specific ways. Two of my favorite 'things' At the *code level* are **readability**
and **modifiability**. The latter is a very old friend of SW architecture's
Copy link
Contributor

Choose a reason for hiding this comment

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

latter->former?

Go’s regexp implementation is known to be relatively slow, but if you think that
regexp needs its compiler and processor, it’s not so surprising.

The hand-optimized version of the Decamel function is almost ten times faster.
Copy link
Contributor

Choose a reason for hiding this comment

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

What exactly are the optimizations? What are the aspects that the reader should pay attention to in the code snippet below?

> just enough -- trust abstraction layering. (See the rule #1.)

Next time you are writing something, think twice -- I do ;-)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think a summary chapter would be a good addition. Just bullets that what did the reader just learned and how to utilize that info in their daily work.


Practise has taught that software architecture must be expressed in various
notations; most are visual. For example, most of us can reason that a
well-grafted state-machine diagram must be faster than a code written our
Copy link
Contributor

Choose a reason for hiding this comment

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

faster -> faster to read?

@github-actions
Copy link
Contributor

PR created by lainio

@github-actions
Copy link
Contributor

PR created by lainio

@lainio lainio merged commit cdab429 into dev Oct 16, 2023
5 checks passed
@lainio lainio deleted the go-performance-refactoring-learnings branch October 16, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants