You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2019/04/12 16:38:00 UTC
[jira] [Resolved] (CAMEL-13414) Date.getTime() can be changed to
System.currentTimeMillis()
[ https://issues.apache.org/jira/browse/CAMEL-13414?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-13414.
---------------------------------
Resolution: Fixed
Assignee: Claus Ibsen
Fix Version/s: 3.0.0-M3
3.0.0
Thanks for the PR.
However there is no critical execution path / bottleneck in camel where date getTime is called excessively. But nevertheless this is a nice little improvement.
> Date.getTime() can be changed to System.currentTimeMillis()
> -----------------------------------------------------------
>
> Key: CAMEL-13414
> URL: https://issues.apache.org/jira/browse/CAMEL-13414
> Project: Camel
> Issue Type: Improvement
> Reporter: bd2019us
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 3.0.0, 3.0.0-M3
>
> Attachments: 1.patch
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Hello,
> I found that System.currentTimeMillis() can be used here instead of new Date.getTime().
> Since new Date() is a thin wrapper of light method System.currentTimeMillis(). The performance will be greatly damaged if it is invoked too much times.
> According to my local testing at the same environment, System.currentTimeMillis() can achieve a speedup to 5 times (435 ms vs 2073 ms), when these two methods are invoked 5,000,000 times.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)