Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:20
erlang
2835-Optimize-timestamps.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2835-Optimize-timestamps.patch of Package erlang
From 9596536f49e906a7bb13c0dc36a61ad791d5d158 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen <raimo@erlang.org> Date: Sun, 16 Feb 2020 00:23:08 +0100 Subject: [PATCH 5/6] Optimize timestamps Using simply monotonic time and setting a calculated start time should be more efficient since taking a timestamp only calls one time BIF instead of 3. --- lib/kernel/src/inet_db.erl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/kernel/src/inet_db.erl b/lib/kernel/src/inet_db.erl index 33b10f54a2..491cb9c8d0 100644 --- a/lib/kernel/src/inet_db.erl +++ b/lib/kernel/src/inet_db.erl @@ -1184,7 +1184,7 @@ handle_set_file( File = filename:flatten(Fname), ets:insert(Db, {res_optname(Option), File}), ets:insert(Db, {TagInfo, undefined}), - TimeZero = - (?RES_FILE_UPDATE_TM + 1), % Early enough + TimeZero = times() - (?RES_FILE_UPDATE_TM + 1), % Early enough ets:insert(Db, {TagTm, TimeZero}), {reply,ok,State}; true -> @@ -1554,8 +1554,9 @@ cache_rr(_Db, Cache, RR) -> ets:insert(Cache, RR). times() -> - erlang:convert_time_unit(erlang:monotonic_time() - erlang:system_info(start_time), - native, second). + erlang:monotonic_time(second). + %% erlang:convert_time_unit(erlang:monotonic_time() - erlang:system_info(start_time), + %% native, second). %% lookup and remove old entries -- 2.16.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor