Ostatnio udało nam się zrównoleglić przetwarzanie naszych zapytań. Jednak wydajność tego rozwiązania okazała się mocno rozczarowująca. Dzisiaj sprawdzimy co nie zagrało i jak przybliżyć rezultaty do oczekiwań. Użyjemy narzędzia VTune od Intela – od niedawna można z niego korzystać za darmo.
Czytaj dalej Architektura serwerów – wydajność przetwarzania zapytań cz.3Kategoria: Performance
Architektura serwerów – wydajność przetwarzania zapytań cz.2
Kontynuujemy nasze zmagania z przetwarzaniem zapytań. W pierwszej części zdefiniowaliśmy problem i podjęliśmy pierwsze próby implementacji rozwiązania. Szybko jednak okazało się, że istnieją lepsze metody. Dzisiaj będziemy eksperymentować z wielowątkowością. Oczywiście nie obejdzie się bez problemów…
Czytaj dalej Architektura serwerów – wydajność przetwarzania zapytań cz.2Architektura serwerów – wydajność przetwarzania zapytań cz.1
Ten wpis rozpoczyna krótką serię na temat architektury serwerów. Będzie to analiza różnych podejść skupiająca się na badaniu wydajności poszczególnych taktyk. Eksperymenty będą wykonywane na systemie Linux z użyciem różnych narzędzi jak np. Intel VTune, perf, dtrace itp. Pokażę różnorakie triki aby wydobyć poszczególne metryki. Artykuły będą raczej trudne, przydatne głownie dla programistów i inżynierów zajmujących się tematyką wydajności aplikacji sieciowych i serwerowych.
Czytaj dalej Architektura serwerów – wydajność przetwarzania zapytań cz.1
7 multi-threading and concurrency deadly sins
Let’s see what kind of pitfalls are common in multi-threading & concurrency world. This kind of code is simply hard to write and even harder to maintain. I’m going to share what can go wrong and how to avoid many traps.
Yet another top-friend: irqtop
Some time ago I wrote an article about top-tools. Today I’d like to add another one to the list, that is, irqtop which is very useful for performance measurements and investigations. I may be biased a little bit because I have contributed to that project but the tool has given me help in many cases so I have no doubt about its value. Let me show you what’s that.
Linux top-tools: performance measurements
This article presents a short list of very useful tools which are used for getting some information about what’s going on in our Linux system. These tools show some of the system’s resources utilization and saturation. Top-tools share one common property, that is, give a snapshot of certain properties in real time. Also they work in command line mode so there is no need to have a graphics user interface, perfect for servers. Let’s see what we can get and measure.
std::vector vs sorted std::vector vs std::set
In this short article I’m going to make a comparison between std::vector, sorted std::vector and std::set. However, I’m going to focus only on one aspect – which collection is faster during lookup.
Looks like the answer is rather trivial – std::map and sorted std::vector offer access to any element in O(log n) time while unsorted std::vector offers linear finding. To be precise – std::vector + std::find as std::vector doesn’t have built-in find function. Indeed, sorted collections are winners… Or maybe the answer is not so trivial? Czytaj dalej std::vector vs sorted std::vector vs std::set
New word order – sorting
Almost every modern language comes with sorting procedures. Is there any reason to dive into?
Very often it doesn’t matter which sorting procedure we select. Especially when we’re sorting a relatively small set of data, say, less than 1000 records, and the performance is not critical. Moreover, some languages give no options but one sorting procedure (taking into consideration only basic language facilities).
But what if we have gigabytes to be sorted? Let’s check out that case. Czytaj dalej New word order – sorting
Ethereal stuff – volatile
In this article I’m going to share some details about the volatile
keyword available in a number of programming languages like C++, C, Java. During my professional career, I have found out that the volatile
type qualifier is frequently misunderstood and, what is even worse, incorrectly used (leading to nasty bugs).
I’ll show the differences between C/C++ and Java languages and present some examples. However, this is not a definitive guide. The main purpose of this article is to give some overview and highlight potential problems.
The volatile
keyword differs from language to language, thus we can’t just write one definition for all. Fortunately, the volatile
type identifier serves the same purpose in C and C++ (albeit C++ slightly extends the definition). Czytaj dalej Ethereal stuff – volatile