Correct me if I'm wrong but isn't this solution kind of inneficient in terms of performance in a high concurrency scenario??
The thing is that everytime you invoke String.matches it has to compile the regex before evaluating the String. If you compile
the regular expression in advance using an static variable with Pattern.compile() it will perform way better than this solution.
Isn't it?
you are absolutely correct, using a pattern as static variable is about 3-4 times faster.
Correct me if I'm wrong but isn't this solution kind of inneficient in terms of performance in a high concurrency scenario??
The thing is that everytime you invoke String.matches it has to compile the regex before evaluating the String. If you compile
the regular expression in advance using an static variable with Pattern.compile() it will perform way better than this solution.
Isn't it?
Regards.
yes, fixed.
The example of how to implement the "height(t)" method is wrong
"p.height(0.2) #=> 4.643 (Calculation: -16(0.2)^2 + (2cos(45º))(0.2) + 5)"
Should be (2sin(45º))(0.2), like describe in height_eq method. we should use sin function, I guess