Skip to content

Commit b222aab

Browse files
committed
Removing named events as they have a speed impact
1 parent 414b44f commit b222aab

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

extracted/vm/src/win/aioWin.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,13 @@ EXPORT(void) aioEnable(sqInt fd, void *clientData, int flags){
274274
aioFileDescriptor->clientData = clientData;
275275
aioFileDescriptor->flags = flags;
276276

277-
sprintf(name, "R%p", (void*)fd);
278-
aioFileDescriptor->readEvent = (HANDLE)CreateEventA(NULL, TRUE, FALSE, name);
277+
// Using named events is great for debugging, but it has an impact in speed.
278+
// Use wisely.
279279

280-
// aioFileDescriptor->readEvent = (HANDLE)WSACreateEvent();
280+
// sprintf(name, "R%p", (void*)fd);
281+
// aioFileDescriptor->readEvent = (HANDLE)CreateEventA(NULL, TRUE, FALSE, name);
282+
283+
aioFileDescriptor->readEvent = (HANDLE)WSACreateEvent();
281284

282285
numberOfEvents++;
283286

@@ -286,11 +289,10 @@ EXPORT(void) aioEnable(sqInt fd, void *clientData, int flags){
286289
logError("Error WSACreateEvent READ: %ld", lastError);
287290
}
288291

289-
sprintf(name, "W%p", (void*)fd);
290-
291-
aioFileDescriptor->writeEvent = (HANDLE)CreateEventA(NULL, TRUE, FALSE, name);
292+
// sprintf(name, "W%p", (void*)fd);
293+
// aioFileDescriptor->writeEvent = (HANDLE)CreateEventA(NULL, TRUE, FALSE, name);
292294

293-
// aioFileDescriptor->writeEvent = (HANDLE)WSACreateEvent();
295+
aioFileDescriptor->writeEvent = (HANDLE)WSACreateEvent();
294296

295297
numberOfEvents++;
296298

0 commit comments

Comments
 (0)