summaryrefslogtreecommitdiff
path: root/bench
Commit message (Collapse)AuthorAgeFilesLines
* Possible fix for non-MSVC windows compilersRan Benita2023-04-111-1/+1
| | | | | | | | `_MSC_VER` is specific to MSVC, but there can be other compilers targeting windows. Hopefully they do define `_WIN32`, so let's use that. Refs: https://github.com/xkbcommon/libxkbcommon/issues/305 Signed-off-by: Ran Benita <ran@unusedvar.com>
* bench/compose: fix compose file pathRan Benita2021-06-101-1/+1
| | | | | | Forgotten in e2465c2. Signed-off-by: Ran Benita <ran@unusedvar.com>
* ignore: remove no longer relevant gitignore filesRan Benita2021-05-221-4/+0
| | | | | | These were relevant for the autoconf build but now we're meson only. Signed-off-by: Ran Benita <ran@unusedvar.com>
* bench: add atom benchmarkRan Benita2021-04-271-0/+93
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* bench/rulescomp: decrease benchmark iterationsRan Benita2021-04-271-1/+1
| | | | | | No need for more, and easier to convert to milliseconds per iteration. Signed-off-by: Ran Benita <ran@unusedvar.com>
* bench: silence coverity complaint about a double freePeter Hutterer2021-03-191-1/+2
| | | | | | | | | | False positive because we rely on xkb_components_from_rules() to initalize this struct, but let's localize the variable anyway to shut coverity up. libxkbcommon-1.0.3/bench/rules.c:59:9: warning[-Wanalyzer-double-free]: double-free of kccgst.symbols Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* x11: cache X11 atomsRan Benita2020-11-201-0/+108
| | | | | | | | | | | | | | | | | | | | On every keymap notify event, the keymap should be refreshed, which fetches the required X11 atoms. A big keymap might have a few hundred of atoms. A profile by a user has shown this *might* be slow when some intensive amount of keymap activity is occurring. It might also be slow on a remote X server. While I'm not really sure this is the actual bottleneck, caching the atoms is easy enough and only needs a couple kb of memory, so do that. On the added bench-x11: Before: retrieved 2500 keymaps from X in 11.233237s After : retrieved 2500 keymaps from X in 1.592339s Signed-off-by: Ran Benita <ran@unusedvar.com>
* MSVC: Provide an implementation of gettimeofday()Adrian Perez de Castro2019-12-281-1/+31
|
* test/atom: use correct format specifier for size_tRan Benita2019-12-281-1/+1
| | | | | | | | | | | | | | | | | | | From MSVC: test\atom.c(98): note: consider using '%zu' in the format string test\atom.c(98): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t' test\atom.c(100): note: consider using '%zu' in the format string test\atom.c(100): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t' test\atom.c(114): note: consider using '%zu' in the format string test\atom.c(114): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t' test\atom.c(128): note: consider using '%zu' in the format string test\atom.c(128): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t' test\atom.c(130): note: consider using '%zu' in the format string test\atom.c(130): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t' test\atom.c(137): note: consider using '%zu' in the format string test\atom.c(137): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 2 has type 'size_t' Signed-off-by: Ran Benita <ran@unusedvar.com>
* Open files in binary modeRan Benita2019-12-281-1/+1
| | | | | | This turns off some misfeatures on Windows, and does nothing on POSIX. Signed-off-by: Ran Benita <ran@unusedvar.com>
* build: include config.h manuallyRan Benita2019-12-275-0/+10
| | | | | | | | | Previously we included it with an `-include` compiler directive. But that's not portable. And it's better to be explicit anyway. Every .c file should have `include "config.h"` first thing. Signed-off-by: Ran Benita <ran@unusedvar.com>
* bench: simplify the bench helpersRan Benita2018-07-056-137/+50
| | | | | | | | | Trim the API a bit. Also, just always use gettimeofday(), which is portable. Hopefully the system clock doesn't change while a benchmark is running. Signed-off-by: Ran Benita <ran234@gmail.com>
* build: remove unneeded preprocessor include flagsRan Benita2017-07-311-2/+2
| | | | | | Better to avoid these unexpected include paths. Signed-off-by: Ran Benita <ran234@gmail.com>
* bench: fix compilation on hurdRan Benita2016-09-192-0/+3
| | | | | | | | Patch by Samuel Thibault. https://github.com/xkbcommon/libxkbcommon/issues/39 Signed-off-by: Ran Benita <ran234@gmail.com>
* bench/compose: tabs -> spacesRan Benita2016-09-161-4/+4
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* bench: Check for errors opening Compose fileBryce Harrington2016-09-161-0/+6
| | | | | | | | Otherwise it can segfault e.g. running ./compose inside the bench directory. Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Signed-off-by: Ran Benita <ran234@gmail.com>
* test: assert/ignore some warn_unused_result'sRan Benita2016-03-151-5/+8
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* bench: Modify benchmarks for a wider range of platformsKazunobu Kuriyama2015-08-286-48/+242
| | | | | | | | - Add the new files bench.c and bench.h to implement a timer module. - Implement the module with clock_gettime(), mach_absolute_time(), or gettimeofday(), depending on a given platform. - Replace the time measurement code of the benchmark programs with the functions of the module.
* bench/compose: add new benchmarkRan Benita2014-10-052-0/+77
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* Move benchmarks from tests to their own files in bench/Ran Benita2014-10-024-0/+233
The tests only contain tests, and the benchmarks are more visible. Signed-off-by: Ran Benita <ran234@gmail.com>