aboutsummaryrefslogtreecommitdiff
path: root/src/common/wall_clock.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [core/core_timing] better MWAITX and WAITPKG delays (#3984)lizzie2026-05-301-197/+0
| | | | | | | | | | | | | This implements MWAITX and WAITPKG extensions (umonitor, mwait) for CPUs that support them. Reduces wait times and bypasses the timing stuff from the OS that is slow (windows notably). generally it should answer within 0.2 to 0.5 microsecs (since most requests wait for that long). Also does a general rework of static ctors and stuff Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3984 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [common/wall_clock] fix invariant RDTSC divide by 0 (#3961)lizzie2026-05-171-6/+6
| | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3961 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [common] remove ptr indirection on WallClock (#3864)lizzie2026-05-151-43/+162
| | | | | | | | | also devirtualizes manually since compiler doesn't do it with LTO Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3864 Reviewed-by: crueter <crueter@eden-emu.dev>
* [common, core] remove uneeded memory indirection overhead at startup (#3306)lizzie2026-01-161-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for core stuff: just remove unique ptrs that dont need any pointer stability at all (afterall its an allocation within an allocation so yeah) for fibers: Main reasoning behind this is because virtualBuffer<> is stupidly fucking expensive and it also clutters my fstat view ALSO mmap is a syscall, syscalls are bad for performance or whatever ALSO std::vector<> is better suited for handling this kind of "fixed size thing where its like big but not THAT big" (512 KiB isn't going to kill your memory usage for each fiber...) for core.cpp stuff - inlines stuff into std::optional<> as opposed to std::unique_ptr<> (because yknow, we are making the Impl from an unique_ptr, allocating within an allocation is unnecessary) - reorganizes the structures a bit so padding doesnt screw us up (it's not perfect but eh saves a measly 44 bytes) - removes unused/dead code - uses std::vector<> instead of std::deque<> no perf impact expected, maybe some initialisation boost but very minimal impact nonethless lto gets rid of most calls anyways - the heavy issue is with shared_ptr and the cache coherency from the atomics... but i clumped them together because well, they kinda do not suffer from cache coherency - hopefully not a mistake this balloons the size of Impl to about 1.67 MB - which is fine because we throw it in the stack anyways REST OF INTERFACES: most of them ballooned in size as well, but overhead is ok since its an allocation within an alloc, no stack is used (when it comes to storing these i mean) Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3306 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* Rework time service to fix time passing offline.Kelebek12024-01-241-17/+15
|
* qt: add cpu_backend configurationamazingfate2023-11-261-2/+2
|
* common: add arm64 native clockLiam2023-10-081-1/+7
|
* wall_clock: Increase precision requirementsMorph2023-07-271-2/+2
| | | | We are providing a conversion to nanoseconds in NativeClock, which is more precise than the GPU tick.
* (wall, native)_clock: Add GetGPUTickMorph2023-06-071-2/+6
| | | | Allows us to directly calculate the GPU tick without double conversion to and from the host clock tick.
* (wall, native)_clock: Rework NativeClockMorph2023-06-071-45/+28
|
* core_timing: Use higher precision sleeps on WindowsMorph2023-03-051-0/+5
| | | | | | The precision of sleep_for and wait_for is limited to 1-1.5ms on Windows. Using SleepForOneTick() allows us to sleep for exactly one interval of the current timer resolution. This allows us to take advantage of systems that have a timer resolution of 0.5ms to reduce CPU overhead in the event loop.
* wall_clock: Make use of SteadyClockMorph2023-03-051-23/+11
|
* common/x64: Use TSC clock rate from CPUID when availableMarshall Mohror2022-07-061-1/+1
| | | | The current method used to estimate the TSC is fairly accurate - within a few kHz - but the exact value can be extracted from CPUID if available.
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* common: Reduce unused includesameerj2022-03-191-2/+0
|
* common: wall_clock: Check precision against the emulated CPU and CNTFRQMorph2022-01-301-6/+10
| | | | In addition to requiring nanosecond precision, using the native clock requires that the hardware TSC has a precision greater than the emulated CPU and its clock counter.
* common: wall_clock: Utilize constants for ms, us, and ns ratiosMorph2022-01-301-2/+2
|
* wall_clock: use standard wall clock if rtsc frequency is too lowgerman772022-01-271-1/+3
|
* common: wall_clock: Fix integer overflow with StandardWallClock.bunnei2021-02-191-7/+8
| | | | | - Previous optimized impl. resulted in an integer overflow, so revert. - This is our slow/fallback path that should never be really be used, so the optimization in unimportant.
* common: wall_clock: Optimize GetClockCycles/GetCPUCycles to use a single MUL ↵bunnei2021-02-151-8/+9
| | | | instruction.
* audio_core: Make shadowing and unused parameters errorsLioncash2020-12-031-2/+2
| | | | Moves the audio code closer to enabling warnings as errors in general.
* common: Enable warnings as errorsLioncash2020-11-021-1/+1
| | | | Cleans up common so that we can enable warnings as errors.
* common/wall_clock: Add virtual destructorsReinUsesLisp2020-09-301-1/+1
| | | | | | | | From -fsanitize=address, this code wasn't calling the proper destructor. Adding virtual destructors for each inherited class and the base class fixes this bug. While we are at it, mark the functions as final.
* Common/Kernel: Corrections and small bug fixing.Fernando Sahmkow2020-06-271-6/+1
|
* HostTiming: Pause the hardware clock on pause.Fernando Sahmkow2020-06-271-0/+4
|
* Core/HostTiming: Allow events to be advanced manually.Fernando Sahmkow2020-06-181-4/+5
|
* Common/Tests: Clang Format.Fernando Sahmkow2020-06-181-4/+8
|
* Common: Refactor & Document Wall clock.Fernando Sahmkow2020-06-181-8/+5
|
* Common: Implement WallClock Interface and implement a native clock for x64Fernando Sahmkow2020-06-181-0/+90