mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-27 15:52:28 +00:00
Reduce ftrace overhead to 280ns
This commit is contained in:
parent
4245da19e2
commit
c8a2f04058
2 changed files with 33 additions and 17 deletions
|
@ -17,6 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define ShouldUseMsabiAttribute() 1
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/bits/likely.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/bits/weaken.h"
|
||||
|
@ -707,9 +708,14 @@ privileged static size_t kformat(char *b, size_t n, const char *fmt, va_list va,
|
|||
if (p < e) *p = hash;
|
||||
++p;
|
||||
}
|
||||
for (; cols > i; --cols) {
|
||||
if (p < e) {
|
||||
while (cols > i) {
|
||||
if (p + 8 < e && cols - i > 8) {
|
||||
WRITE64LE(p, 0x2020202020202020);
|
||||
cols -= 8;
|
||||
p += 8;
|
||||
} else if (p < e) {
|
||||
*p++ = ' ';
|
||||
--cols;
|
||||
} else {
|
||||
p = kadvance(p, e, cols - i);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue