You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
html2pdf converter using Blink/Chromium, using PyQt5 and PyQtWebEngine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using svd to “compress” an image, using opencv and numpy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This documents our humble attempt at automating the testing of a MIPS project
in Verilog using Perl.
We had two test scripts, general_test.pl and predefined_test.pl.
general_test.pl is made so that you can easily initialize some registers
and pass a set of instructions and check the values of any number of registers
after the execution; it was used for evaluating and grading the project.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Performance of C (and C++) functions: separate implementation and interface, or implementation in header?
Performance of C (and C++) functions: separate implementation and interface, or implementation in header?
Summary: In C, implementing a function in a header file, rather than a separate .c file, provides about 200% performance gain. Maybe it's because the compiler is inlining them. But you may not gain that much in nontrivial projects.
In C++, you need also to apply link-time optimization, with the compiler switch -flto, to have that 200% performance gain.
Note 1: In many projects, especially large ones, the bottleneck is not those non-inlined functions, and separating the implementation from the interface makes compilation faster, thus easier to develop.
Note 2: Algorithmic optimization is most important (chose better algorithms). If you really need more performance, investigate other possibilities, like parallelizing your code, vectorize some parts of it, etc.
Summary: In C++, implementing a 2D array as a 1D array can provide about 125% to 130% performance gain. It's not much if your application is not performance critical, but the handling code of 1D arrays is still far simpler than that of 2D arrays.
Overview
Let us write a small C++ class for matrices, with multiplying and printing functions. And let us benchmark it to see how can we make it most performant. Obviously we need to choose a performant algorithm; e.g., using Strassen algorithm is far better than multiplying matrices the naïve way. But I will do it the naïve way just to focus on one aspect only, namely, the performance impact of using 2D vs 1D dynamically allocated arrays.
I will compile using GCC (g++) with the highest level of optimization (-O3). I am using GCC 5.4.0.