Uwe Hermann [Thu, 16 Mar 2017 22:29:24 +0000 (23:29 +0100)]
Increase session saving chunk size for much better performance.
Increasing the StoreSession chunk size from 1Msamples to 10Msamples
leads to massively faster session saving due to reduced overhead.
In some cases a 2x (or more) speed-up has been observed. A further increase
to, say, 100Msamples shows no further noticeable improvements.
This also has the additional benefit of generating fewer entries/files
within the sigrok session (*.sr) output/ZIP files, which can potentially
be beneficial for very long captures.
V1 will construct a temporary std::string from the string literal "foo",
another copy of that temporary object will be constructed and placed
into the vector 'v', then the temporary object's destructor will be called.
V2 will simply create a std::string directly in the vector 'v', i.e.
there's only one construction (not 2) and no destructor needs to be called.
Using make_shared() over manual construction has multiple advantages:
- It's shorter to write and easier to read.
V1: auto sb = shared_ptr<Foo>(new Foo());
V2: auto sb = make_shared<Foo>();
- The type "Foo" is repeated less often (less code duplication, lower
risk of forgetting to update one of the "Foo"s upon copy-paste etc.)
- Manual construction leads to two individual allocations (actual data and
the control block of the shared_ptr). Using make_shared() will only lead
to one allocation, which has performance, cache-locality and memory
consumption benefits.
- It's exception-safe, whereas manual construction is not necessarily:
Uwe Hermann [Mon, 6 Mar 2017 07:41:42 +0000 (08:41 +0100)]
Increase decoding chunk size for much better performance.
Increasing the (max) decoding chunk size from 4ksamples to 10Msamples
leads to massively faster protocol decoding due to reduced overhead
related to srd_session_send() and other functions invoked internally.
In some cases a 2x (or more) speed-up has been observed.
Bring back sticky scroll and coloured background shortcuts.
Converted the actions to QShortcut. We do not use the actions anywhere
else in the code and they were not being triggered using the setShortcut
setting. Additionally expanded the view background color to be a
toggleable attribute.
Ctrl-Q is commonly used to close the application, and Ctrl-W usually is
used to close the current tab. According to the Qt::Modifier
documentation this setup should work seamlessly on Mac OS where Meta is
usually used in place of Ctrl.
This is a proposed solution to reenable the <Space> shortcut for
Run/Stop. It seems that setShortcut on QToolButton is not working, but
it seems that adding QShortcut works as a workaround.
Soeren Apel [Sat, 18 Feb 2017 07:21:00 +0000 (08:21 +0100)]
Segment: Move definition of MaxChunkSize
This fixes a compile error with clang:
pv/data/segment.cpp.o: In function `unsigned long const& std::min<unsigned long>(unsigned long const&, unsigned long const&)':
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_algobase.h:200: undefined reference to `pv::data::Segment::MaxChunkSize'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Uwe Hermann [Fri, 17 Feb 2017 08:27:20 +0000 (09:27 +0100)]
pulseview_cross.nsi.in: Use Python 3.4 (Windows XP support).
The last Python version to officially support Windows XP was 3.4.x.
We'll keep the Windows installers at that version for the time being,
until Windows XP support is no longer feasible (e.g. because important
sigrok requirements such as Qt, glib, or libusb drop XP suppport).
Soeren Apel [Wed, 8 Feb 2017 19:33:48 +0000 (20:33 +0100)]
Free unused segment memory after acquisition
Segments allocate chunks of MaxChunkSize bytes each.
Most likely, the last allocated chunk isn't fully used,
so there's memory going to waste. This patch fixes this
by allocating a chunk of the required size that replaces
the last standard chunk.
Soeren Apel [Wed, 8 Feb 2017 17:30:41 +0000 (18:30 +0100)]
Switch segment storage from single vector to vector of arrays
Previously, PV would run out of storage space for the data
segments because data was stored in a vector. As a vector allows
contiguous access to the underlying data (much like an array),
it needs a contiguous section of memory. With incoming data and
constant resizing of the vector, the OS at some point can no
longer supply such a section of memory, causing PV to abort
acquisition.
This change fixes this by using several chunks that are never
grown in size. Instead, new chunks are allocated and added to
the vector as needed. This way, the OS will be able to provide
memory until it runs out of system memory.
Uwe Hermann [Sun, 29 Jan 2017 18:36:59 +0000 (19:36 +0100)]
Build fixes for Qt5 Windows/mingw/MXE support.
We currently need to (ab)use pkg-config to get all the required
Qt5 static linking dependencies right, since this doesn't yet
work properly in MXE's cmake.
We use ${PKGDEPS_STATIC_LDFLAGS} instead of ${PKGDEPS_STATIC_LIBRARIES}
to avoid some linker issues related to libbz2.
We need to add Qt5::QSvgPlugin, Qt5::QWindowsIntegrationPlugin,
Qt5PlatformSupport and all the Qt5 libs and their dependencies to
the link libraries list (for both PulseView and the unit tests).
In one of the source code files we need to explicitly list all
static Qt plugins via Q_IMPORT_PLUGIN to make static builds work,
which is currently QWindowsIntegrationPlugin and QSvgPlugin.
We're only focusing on having a working Qt5 build for Windows,
as we no longer need to or want to support Qt4 there.
Details:
https://github.com/mxe/mxe/issues/1642
Thanks to Tony Theodore for the help!
This should also fix bug #871, since we're now building with Qt >= 5.6
which has high-DPI support in general.
Tested via manual specification (might need further changes, though):
Soeren Apel [Fri, 13 Jan 2017 17:36:00 +0000 (18:36 +0100)]
TraceView: Center traces more than once
This is to make sure the traces are centered when the view is
first drawn but also properly centered when the final size is
known. This fixes a "jumping" display when opening a new trace
view in addition to an existing one.
Soeren Apel [Tue, 11 Oct 2016 13:55:55 +0000 (15:55 +0200)]
MainWindow: Don't use get_active_view() to determine active session
While it would be neat if it worked, it unfortunately doesn't as
the currently focused item may not be related to any view - e.g.
when one of the tabs of the QTabWidget was clicked.
For this reason, we store the last session the user interacted
with and treat it as the currently focused session.
Soeren Apel [Tue, 4 Oct 2016 17:32:58 +0000 (19:32 +0200)]
MainWindow: Use regular pointer for QDockWidgets
Using shared_ptrs conflicts with the Qt memory management,
so we can't use them if we don't have control over when
those objects are deleted by Qt. In this case, we need to
handle the dock widgets properly.