summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2016-12-26 01:24:35 +0100
committerTillmann Karras <tilkax@gmail.com>2016-12-26 01:24:35 +0100
commit57a005ff3e65e131f95686b96230120f198ac9bd (patch)
tree07a3c4c3899d50edbbed957b60d1617f22baffe7 /Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
parent8c99f6002617069d4e5ddb0b01690641c9b9cd33 (diff)
evdev: reduce startup time
GetName() creates a new evdev device which calls tons of ioctls. But the main culprit is close() which for input devices appears to be a slow path in the kernel. This commit reduces PopulateDevices() by 50% on my laptop, but ~730 ms is still ridiculously slow for something that isn't needed right away.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
index 58f92f29a4..bb29e216cd 100644
--- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
@@ -175,12 +175,12 @@ void PopulateDevices()
{
// Unfortunately udev gives us no way to filter out the non event device interfaces.
// So we open it and see if it works with evdev ioctls or not.
- std::string name = GetName(devnode);
auto input = std::make_shared<evdevDevice>(devnode);
if (input->IsInteresting())
{
g_controller_interface.AddDevice(std::move(input));
+ std::string name = GetName(devnode);
s_devnode_name_map.insert(std::pair<std::string, std::string>(devnode, name));
}
}