Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
5da00173
Commit
5da00173
authored
Apr 17, 2016
by
Oleg Korshul
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
добавлена возможность логгировать скорость работы билдера
parent
6f34fb4f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
DesktopEditor/doctrenderer/docbuilder.cpp
DesktopEditor/doctrenderer/docbuilder.cpp
+21
-0
DesktopEditor/doctrenderer/nativecontrol.h
DesktopEditor/doctrenderer/nativecontrol.h
+6
-0
No files found.
DesktopEditor/doctrenderer/docbuilder.cpp
View file @
5da00173
...
...
@@ -91,6 +91,8 @@ public:
bool
ExecuteCommand
(
const
std
::
wstring
&
command
,
bool
bIsSave
=
true
)
{
LOGGER_SPEED_START
std
::
string
commandA
=
U_TO_UTF8
(
command
);
//commandA = "_api." + commandA;
...
...
@@ -104,6 +106,8 @@ public:
v8
::
Local
<
v8
::
String
>
source
=
v8
::
String
::
NewFromUtf8
(
m_isolate
,
commandA
.
c_str
());
v8
::
Local
<
v8
::
Script
>
script
=
v8
::
Script
::
Compile
(
source
);
LOGGER_SPEED_LAP
(
"compile_command"
)
if
(
try_catch
.
HasCaught
())
{
std
::
wstring
strCode
=
to_cstring
(
try_catch
.
Message
()
->
GetSourceLine
());
...
...
@@ -130,11 +134,15 @@ public:
}
}
LOGGER_SPEED_LAP
(
"run_command"
)
return
true
;
}
bool
OpenFile
(
const
std
::
wstring
&
path
,
const
std
::
string
&
sString
)
{
LOGGER_SPEED_START
v8
::
Context
::
Scope
context_scope
(
m_context
);
v8
::
TryCatch
try_catch
;
...
...
@@ -142,6 +150,8 @@ public:
v8
::
Local
<
v8
::
String
>
source
=
v8
::
String
::
NewFromUtf8
(
m_isolate
,
sString
.
c_str
());
v8
::
Local
<
v8
::
Script
>
script
=
v8
::
Script
::
Compile
(
source
);
LOGGER_SPEED_LAP
(
"compile"
)
if
(
try_catch
.
HasCaught
())
{
std
::
wstring
strCode
=
to_cstring
(
try_catch
.
Message
()
->
GetSourceLine
());
...
...
@@ -167,6 +177,7 @@ public:
return
false
;
}
}
LOGGER_SPEED_LAP
(
"run"
)
CNativeControl
*
pNative
=
NULL
;
bool
bIsBreak
=
false
;
...
...
@@ -261,6 +272,8 @@ public:
if
(
!
bIsBreak
)
bIsBreak
=
!
this
->
ExecuteCommand
(
L"_api.asc_SetSilentMode(true);"
,
false
);
LOGGER_SPEED_LAP
(
"open"
)
return
!
bIsBreak
;
}
};
...
...
@@ -528,6 +541,8 @@ namespace NSDoctRenderer
bool
OpenFile
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
params
)
{
LOGGER_SPEED_START
CheckFileDir
();
NSDirectory
::
CreateDirectory
(
m_sFileDir
+
L"/changes"
);
...
...
@@ -672,6 +687,8 @@ namespace NSDoctRenderer
NSFile
::
CFileBinary
::
Remove
(
sTempFileForParams
);
LOGGER_SPEED_LAP
(
"open_convert"
)
if
(
0
==
nReturnCode
)
return
true
;
...
...
@@ -702,6 +719,8 @@ namespace NSDoctRenderer
return
false
;
}
LOGGER_SPEED_START
NSStringUtils
::
CStringBuilder
oBuilder
;
oBuilder
.
WriteString
(
L"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?><TaskQueueDataConvert><m_sFileFrom>"
);
...
...
@@ -842,6 +861,8 @@ namespace NSDoctRenderer
NSFile
::
CFileBinary
::
Remove
(
sTempFileForParams
);
LOGGER_SPEED_LAP
(
"save_convert"
)
if
(
0
==
nReturnCode
)
return
true
;
...
...
DesktopEditor/doctrenderer/nativecontrol.h
View file @
5da00173
...
...
@@ -871,6 +871,12 @@ public:
m_dwTime = dwCur;
}
};
#define LOGGER_SPEED_START CLoggerSpeed __logger_speed;
#define LOGGER_SPEED_LAP(__logger_param) __logger_speed.Lap(#__logger_param);
#else
#define LOGGER_SPEED_START
#define LOGGER_SPEED_LAP(__logger_param)
#endif
//////////////////////////////////////////////////////////////////////////////
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment