Tag Archives: performance

How golang garbage collection works

It is a Mark-and-Sweep GC. Phases Mark Stop-the-World: Set write barrier (to know how much was allocated during maark phase) Concurrent: Mark all memory which is still in use by the app Stop-the-World: Remove write barrier Concurrent: Sweep (it actually happens on new allocations) Details/Algorithm It’s a tri-color process: grey for objects to check, black …

Read more

PgBouncer and prepared statements

In our system, we use connection pooler called PgBouncer as a proxy to PostgreSQL server. PgBouncer has two main modes Session pooling mode This mode is less performant (it’s a default mode). When a client connects, a server connection will be assigned to it for the whole duration it stays connected. So it does not …

Read more

How go code is being compiled to assembler code

https://go.godbolt.org/z/31FyJ3 I was interested in comparing line 15 vs line 17 of the following code:

How to analyze the performance of your go application in production

You should definitely use chi’s middleware for running pprof and stuff in your admin panel. That’s the repo — https://github.com/go-chi/chi That’s the profiler — https://github.com/go-chi/chi/blob/master/middleware/profiler.go CPU profiling After that you can run something like this in shell:

Or just open it in the browser:

If it opens something different then your browser (sublime …

Read more

PostgreSQL: TOP slow queries

Simple way to detect browser’s FPS via JS

It’s dumb and dead simple but works. You can even track browser’s metrics with that.

Performance comparison table for javascript frameworks

http://www.stefankrause.net/js-frameworks-benchmark7/table.html Example results are as follows:

Особенности setInterval на практике

Раньше я был уверен, что в этом случае setInterval ставится на выполнение раз в секунду, что бы ни произошло:

Но, видимо, это не так. Если в очереди уже есть задача от этого интервала, то новая задача туда не поставится. Вот пример: http://jsbin.com/rifahi/edit?html,js,output Поэтому сам с собой он борьбу за ресурсы не устроит. Но в …

Read more

Советы по производительности AngularJS

Это перепечатка статьи Релиз Angular.js 2.0 приближается, а проблемы с производительностью первой версии все еще остаются. Эта статья посвящена оптимизации Angular.js приложений и будет полезна как начинающим, так и тем, кто уже использует этот фреймворк, но еще не сталкивался с проблемами его производительности. Немного простой теории Как известно, Angular.js это декларативный фронт-енд фреймворк, предоставляющий удобный …

Read more

Ошибки при разработке AngularJS-приложения

Старайся содержать контроллеры максимально простыми. Весь повторяющийся код выноси в сервисы. Разделяй объявление методов контроллера и тела функций

Не полагайся на наследование $scope-ов контроллеров. Этот ад ты потом не сможешь поддерживать. Достаточно будет при редизайне перенести блоки или выделить кусок контроллера в сервис. А представить нормальное тестирование этого я даже не берусь. UPD: Лучше …

Read more