mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
startuptime: always enable startuptime
Removes the STARTUPTIME define.
This commit is contained in:

committed by
Justin M. Keyes

parent
ab1eec10a1
commit
fb15cbbaea
@@ -9731,9 +9731,7 @@ static void f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
"cmdline_info",
|
"cmdline_info",
|
||||||
"signs",
|
"signs",
|
||||||
"smartindent",
|
"smartindent",
|
||||||
#ifdef STARTUPTIME
|
|
||||||
"startuptime",
|
"startuptime",
|
||||||
#endif
|
|
||||||
"statusline",
|
"statusline",
|
||||||
"spell",
|
"spell",
|
||||||
"syntax",
|
"syntax",
|
||||||
|
@@ -2261,10 +2261,6 @@ do_source (
|
|||||||
void *save_funccalp;
|
void *save_funccalp;
|
||||||
int save_debug_break_level = debug_break_level;
|
int save_debug_break_level = debug_break_level;
|
||||||
scriptitem_T *si = NULL;
|
scriptitem_T *si = NULL;
|
||||||
#ifdef STARTUPTIME
|
|
||||||
proftime_T tv_rel;
|
|
||||||
proftime_T tv_start;
|
|
||||||
#endif
|
|
||||||
proftime_T wait_start;
|
proftime_T wait_start;
|
||||||
|
|
||||||
p = expand_env_save(fname);
|
p = expand_env_save(fname);
|
||||||
@@ -2393,10 +2389,13 @@ do_source (
|
|||||||
firstline = p;
|
firstline = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STARTUPTIME
|
// start measuring script load time if --startuptime was passed and
|
||||||
if (time_fd != NULL)
|
// time_fd was successfully opened afterwards.
|
||||||
time_push(&tv_rel, &tv_start);
|
proftime_T rel_time;
|
||||||
#endif
|
proftime_T start_time;
|
||||||
|
if (time_fd != NULL) {
|
||||||
|
time_push(&rel_time, &start_time);
|
||||||
|
}
|
||||||
|
|
||||||
if (do_profiling == PROF_YES)
|
if (do_profiling == PROF_YES)
|
||||||
prof_child_enter(&wait_start); /* entering a child now */
|
prof_child_enter(&wait_start); /* entering a child now */
|
||||||
@@ -2490,13 +2489,12 @@ do_source (
|
|||||||
smsg((char_u *)_("continuing in %s"), sourcing_name);
|
smsg((char_u *)_("continuing in %s"), sourcing_name);
|
||||||
verbose_leave();
|
verbose_leave();
|
||||||
}
|
}
|
||||||
#ifdef STARTUPTIME
|
|
||||||
if (time_fd != NULL) {
|
if (time_fd != NULL) {
|
||||||
vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);
|
vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);
|
||||||
time_msg((char *)IObuff, &tv_start);
|
time_msg((char *)IObuff, &start_time);
|
||||||
time_pop(tv_rel);
|
time_pop(rel_time);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* After a "finish" in debug mode, need to break at first command of next
|
* After a "finish" in debug mode, need to break at first command of next
|
||||||
|
@@ -1207,9 +1207,7 @@ EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP"));
|
|||||||
/* For undo we need to know the lowest time possible. */
|
/* For undo we need to know the lowest time possible. */
|
||||||
EXTERN time_t starttime;
|
EXTERN time_t starttime;
|
||||||
|
|
||||||
#ifdef STARTUPTIME
|
|
||||||
EXTERN FILE *time_fd INIT(= NULL); /* where to write startup timing */
|
EXTERN FILE *time_fd INIT(= NULL); /* where to write startup timing */
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some compilers warn for not using a return value, but in some situations we
|
* Some compilers warn for not using a return value, but in some situations we
|
||||||
|
@@ -711,7 +711,6 @@ main_loop (
|
|||||||
|
|
||||||
do_redraw = FALSE;
|
do_redraw = FALSE;
|
||||||
|
|
||||||
#ifdef STARTUPTIME
|
|
||||||
/* Now that we have drawn the first screen all the startup stuff
|
/* Now that we have drawn the first screen all the startup stuff
|
||||||
* has been done, close any file for startup messages. */
|
* has been done, close any file for startup messages. */
|
||||||
if (time_fd != NULL) {
|
if (time_fd != NULL) {
|
||||||
@@ -720,7 +719,6 @@ main_loop (
|
|||||||
fclose(time_fd);
|
fclose(time_fd);
|
||||||
time_fd = NULL;
|
time_fd = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1467,16 +1465,14 @@ static void init_params(mparm_T *paramp, int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
static void init_startuptime(mparm_T *paramp)
|
static void init_startuptime(mparm_T *paramp)
|
||||||
{
|
{
|
||||||
#ifdef STARTUPTIME
|
for (int i = 1; i < paramp->argc; i++) {
|
||||||
int i;
|
|
||||||
for (i = 1; i < paramp->argc; ++i) {
|
|
||||||
if (STRICMP(paramp->argv[i], "--startuptime") == 0 && i + 1 < paramp->argc) {
|
if (STRICMP(paramp->argv[i], "--startuptime") == 0 && i + 1 < paramp->argc) {
|
||||||
time_fd = mch_fopen(paramp->argv[i + 1], "a");
|
time_fd = mch_fopen(paramp->argv[i + 1], "a");
|
||||||
time_start("--- VIM STARTING ---");
|
time_start("--- VIM STARTING ---");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
starttime = time(NULL);
|
starttime = time(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2221,9 +2217,7 @@ static void usage(void)
|
|||||||
main_msg(_("-s <scriptin>\tRead Normal mode commands from file <scriptin>"));
|
main_msg(_("-s <scriptin>\tRead Normal mode commands from file <scriptin>"));
|
||||||
main_msg(_("-w <scriptout>\tAppend all typed commands to file <scriptout>"));
|
main_msg(_("-w <scriptout>\tAppend all typed commands to file <scriptout>"));
|
||||||
main_msg(_("-W <scriptout>\tWrite all typed commands to file <scriptout>"));
|
main_msg(_("-W <scriptout>\tWrite all typed commands to file <scriptout>"));
|
||||||
#ifdef STARTUPTIME
|
|
||||||
main_msg(_("--startuptime <file>\tWrite startup timing messages to <file>"));
|
main_msg(_("--startuptime <file>\tWrite startup timing messages to <file>"));
|
||||||
#endif
|
|
||||||
main_msg(_("-i <viminfo>\t\tUse <viminfo> instead of .viminfo"));
|
main_msg(_("-i <viminfo>\t\tUse <viminfo> instead of .viminfo"));
|
||||||
main_msg(_("--api-msgpack-metadata\tDump API metadata information and exit"));
|
main_msg(_("--api-msgpack-metadata\tDump API metadata information and exit"));
|
||||||
main_msg(_("-h or --help\tPrint Help (this message) and exit"));
|
main_msg(_("-h or --help\tPrint Help (this message) and exit"));
|
||||||
|
@@ -6,9 +6,7 @@
|
|||||||
#include "nvim/os/time.h"
|
#include "nvim/os/time.h"
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/func_attr.h"
|
||||||
|
|
||||||
#ifdef STARTUPTIME
|
#include "nvim/globals.h" // for the global `time_fd` (startuptime)
|
||||||
#include "nvim/vim.h" // for the global `time_fd`
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "profile.c.generated.h"
|
# include "profile.c.generated.h"
|
||||||
@@ -187,8 +185,7 @@ int profile_cmp(proftime_T tm1, proftime_T tm2) FUNC_ATTR_CONST
|
|||||||
return sgn64((int64_t)(tm2 - tm1));
|
return sgn64((int64_t)(tm2 - tm1));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STARTUPTIME
|
/// globals for use in the startuptime related functionality (time_*).
|
||||||
|
|
||||||
static proftime_T g_start_time;
|
static proftime_T g_start_time;
|
||||||
static proftime_T g_prev_time;
|
static proftime_T g_prev_time;
|
||||||
|
|
||||||
@@ -282,5 +279,3 @@ void time_msg(const char *mesg, const proftime_T *start)
|
|||||||
g_prev_time = now;
|
g_prev_time = now;
|
||||||
fprintf(time_fd, ": %s\n", mesg);
|
fprintf(time_fd, ": %s\n", mesg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@@ -6,13 +6,9 @@
|
|||||||
|
|
||||||
typedef uint64_t proftime_T;
|
typedef uint64_t proftime_T;
|
||||||
|
|
||||||
#ifdef STARTUPTIME
|
|
||||||
#define TIME_MSG(s) do { \
|
#define TIME_MSG(s) do { \
|
||||||
if (time_fd != NULL) time_msg(s, NULL); \
|
if (time_fd != NULL) time_msg(s, NULL); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#else
|
|
||||||
#define TIME_MSG(s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "profile.h.generated.h"
|
# include "profile.h.generated.h"
|
||||||
|
@@ -145,11 +145,7 @@ static char *(features[]) = {
|
|||||||
"+scrollbind",
|
"+scrollbind",
|
||||||
"+signs",
|
"+signs",
|
||||||
"+smartindent",
|
"+smartindent",
|
||||||
#ifdef STARTUPTIME
|
|
||||||
"+startuptime",
|
"+startuptime",
|
||||||
#else // ifdef STARTUPTIME
|
|
||||||
"-startuptime",
|
|
||||||
#endif // ifdef STARTUPTIME
|
|
||||||
"+statusline",
|
"+statusline",
|
||||||
"+syntax",
|
"+syntax",
|
||||||
"+tag_binary",
|
"+tag_binary",
|
||||||
|
Reference in New Issue
Block a user