-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance issue #343
Comments
#define DOCTEST_IMPLEMENT_FIXTURE(der, base, func, decorators) \
namespace { \
struct der : public base \
{ \
void f(); \
}; \
static void func() { \
der v; \
v.f(); \
} \
DOCTEST_REGISTER_FUNCTION(DOCTEST_EMPTY, func, decorators) \
} \
inline DOCTEST_NOINLINE void der::f() Looks like this is one of the problems, something with the macro syntax. Even just
causes some problems |
This looks like there are widespread slowness with this file. Though this may not be the grammars fault. The total tim according to perf is 468ms. The wall time was 11 seconds. Additionally there are multiple lines from vscode-textmate of:
Perf reportmatch failure matched, not chosen matched, chosen Edit: after getting a more accurate total time: |
What would cause the tokenizer to take so long? I thought it was a pretty simple assignment. |
I'm guessing it takes several hundred milliseconds to decide that there is a loop. It complains 13 times. |
I'll have time to work on a fix tomorrow |
There may be some loop going on with the macros
|
Can the dependency switch back to microsoft's vscode-textmate. With the recent updates, they no longer behave the same. |
Switching to using vscode-textmate gives a much more realistic report Edit: this is beecause the full file was being parsed as source.c Perf Resultsmatch failure pattern name average time total time source.cpp:4887 0.187313 3.746 source.cpp:17154 0.105864 0.953 source.cpp:6514 0.035632 1.497 source.cpp:16874 0.021462 0.193 source.cpp:845 0.020405 0.939 source.cpp:16506 0.019823 0.178 source.cpp:5437 0.014897 0.298 source.cpp:7935 0.010306 0.433 source.cpp:1331 0.010014 0.421 source.cpp:4704 0.009266 0.389 source.cpp:812 0.008863 0.390 source.cpp:20607 0.008499 0.076 source.cpp:1052 0.008355 0.359 source.cpp:1085 0.007531 0.361 source.cpp:1286 0.007380 0.310 source.cpp:11124 0.006999 0.028 source.cpp:14855 0.006996 0.035 source.cpp:1253 0.006673 0.280 source.cpp:4632 0.006352 0.267 source.cpp:5356 0.006139 0.012matched, not chosen matched, chosen |
So line 11467 is the begin pattern for struct. This is likely another form of catastrophic backtracking. |
Yeah, lets permanently switch back |
#define DOCTEST_IMPLEMENT_FIXTURE(der, base, func, decorators) \
namespace { \
struct def : public base \ it has something to do with the spaces after the |
maybe(@spaces) is fairly popular (x8) in generateStructorClassBlock. Maybe try replacing that with |
🎊 that fixed it 100% |
Originally added to:
microsoft/vscode#76579
Code:
https://raw.githubusercontent.com/onqtam/doctest/master/doctest/doctest.h
@matter123 I haven't looked into the cause yet but I imagine its related to the repeated
=
or repeated##
.The text was updated successfully, but these errors were encountered: