mirror of
https://github.com/facebook/zstd.git
synced 2025-09-01 04:42:03 +03:00
bench : added HIGH_PRIORTY
This commit is contained in:
@@ -53,13 +53,17 @@
|
|||||||
|
|
||||||
/* sleep : posix - windows - others */
|
/* sleep : posix - windows - others */
|
||||||
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
|
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
|
||||||
# include <unistd.h>
|
# include <unistd.h> /* sleep */
|
||||||
|
# include <sys/resource.h> /* setpriority */
|
||||||
# define BMK_sleep(s) sleep(s)
|
# define BMK_sleep(s) sleep(s)
|
||||||
|
# define HIGH_PRIORITY setpriority(PRIO_PROCESS, 0, -20)
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# define BMK_sleep(s) Sleep(1000*s)
|
# define BMK_sleep(s) Sleep(1000*s)
|
||||||
|
# define HIGH_PRIORITY SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
|
||||||
#else
|
#else
|
||||||
# define BMK_sleep(s) /* disabled */
|
# define BMK_sleep(s) /* disabled */
|
||||||
|
# define HIGH_PRIORITY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
@@ -207,6 +211,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
|
|||||||
|
|
||||||
/* init */
|
/* init */
|
||||||
if (strlen(displayName)>17) displayName += strlen(displayName)-17; /* can only display 17 characters */
|
if (strlen(displayName)>17) displayName += strlen(displayName)-17; /* can only display 17 characters */
|
||||||
|
HIGH_PRIORITY;
|
||||||
|
|
||||||
/* Init blockTable data */
|
/* Init blockTable data */
|
||||||
{ const char* srcPtr = (const char*)srcBuffer;
|
{ const char* srcPtr = (const char*)srcBuffer;
|
||||||
|
Reference in New Issue
Block a user