New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unix.gettimeofday allocates memory #7446
Comments
Comment author: @dra27 Full discussion (with links to previous GPRs) for that commit at #281. If this is done, then there are other functions (Unix.time, for starters) which should also receive the same treatment (also remember that every change made in unix must be made in win32unix, too - but in this case the CI will catch it, as unix.mli is shared). However, there is a potentially important difference - none of these functions is presently declared external, and it may be important to consider if we want to change that. |
Comment author: @gasche I don't think that we would want to declare |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
This patch makes Unix.time and Unix.gettimeofday be unboxed and @noalloc, which makes them about 20% faster (as measured by a stupid benchmark that does them many times in a loop). This removes the fallback and error-handling paths from gettimeofday. Neither is needed according to Single Unix Specification and POSIX. Fixes: #7446
Original bug ID: 7446
Reporter: markghayden
Status: acknowledged (set by @gasche on 2017-01-01T19:32:56Z)
Resolution: open
Priority: normal
Severity: tweak
Version: 4.04.0
Target version: 4.07.0+dev/beta2/rc1/rc2
Category: standard library
Monitored by: bikal @ygrek
Bug description
Unix.gettimeofday allocates a floating point value instead of returning an unboxed float similar to Sys.time.
Unix.gettimeofday is not really in the standard library, but is included as part of the Ocaml distribution.
The text was updated successfully, but these errors were encountered: