-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Comparing changes
Open a pull request
base repository: mockito/mockito
base: v4.7.0
head repository: mockito/mockito
compare: v4.8.0
- 10 commits
- 63 files changed
- 8 contributors
Commits on Aug 13, 2022
-
Optimize
TypeSafeMatching
iteration over class methods (#2729)`Class.getMethods` is an inefficient method call which is being called on each mock invocation. It ends up constructing new `Method` objects for each method on the class, and this can dominate the overall performance of Mockito mocks. This commit caches the result of the computation. Once concern is that this change uses some static state. I considered: - Instance state - based on where this type is constructed it seemed like it'd be a big imposition on code readability elsewhere. - Weakly referenced map. Mockito has a type for this, but the constructor of that type produces a Thread with which to clean up. Both of these seemed like overkill compared to the overhead expected in the real world (which should be on the order of a few kilobytes of RAM at most). Fixes #2723
Configuration menu - View commit details
-
Copy full SHA for 89698ba - Browse repository at this point
Copy the full SHA 89698baView commit details -
Fixes #2720: Use StackWalker on Java 9+ to create Locations (#2723)
In terms of memory allocations, this reduces the overall memory allocations of creating a location by an order of magnitude in Java 9, and as compared to Java 8. The implementation is somewhat involved due to these desires: - Minimize the amount of work done if the Location is never used. This is done by not converting the StackFrame into a StackTraceElement, instead wrapping in an intermediate state. The StackTraceElement conversion will only occur (internally) if the .getFileName() method is called. - Ensure the implementation is still Serializable. This is ensured with a .writeReplace method. - Minimize the number of allocations, which is basically an exercise in lambda caching. - Ensuring the old mechanism still works on Java 8. Presently on Java 9+, on a stack depth of 1000 the old mechanism will allocate 40kB of RAM per call. The new one will allocate 1.5kB of RAM per call, which is a huge improvement. This is still sadly not the 'close-to-no-overhead' solution I was looking for. I therefore also added a system property that can be used to fully disable Location creation. I'm aware that this is likely not the right approach given Mockito has plugins and settings - mostly looking for guidance here given I'm not sure what would be idiomatic here.
Configuration menu - View commit details
-
Copy full SHA for 73a861f - Browse repository at this point
Copy the full SHA 73a861fView commit details
Commits on Aug 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 2ded10e - Browse repository at this point
Copy the full SHA 2ded10eView commit details
Commits on Aug 22, 2022
-
Bump versions.bytebuddy from 1.12.13 to 1.12.14 (#2734)
Bumps `versions.bytebuddy` from 1.12.13 to 1.12.14. Updates `byte-buddy` from 1.12.13 to 1.12.14 - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](raphw/byte-buddy@byte-buddy-1.12.13...byte-buddy-1.12.14) Updates `byte-buddy-agent` from 1.12.13 to 1.12.14 - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](raphw/byte-buddy@byte-buddy-1.12.13...byte-buddy-1.12.14) Updates `byte-buddy-android` from 1.12.13 to 1.12.14 - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](raphw/byte-buddy@byte-buddy-1.12.13...byte-buddy-1.12.14) --- updated-dependencies: - dependency-name: net.bytebuddy:byte-buddy dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: net.bytebuddy:byte-buddy-agent dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: net.bytebuddy:byte-buddy-android dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for e123c2c - Browse repository at this point
Copy the full SHA e123c2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 160e3da - Browse repository at this point
Copy the full SHA 160e3daView commit details -
Merge pull request #2736 from mockito/static-varargs-call
Drop varargs collector before invoking a user method.
Configuration menu - View commit details
-
Copy full SHA for 9b93df7 - Browse repository at this point
Copy the full SHA 9b93df7View commit details
Commits on Aug 24, 2022
-
Bump com.diffplug.spotless from 6.9.1 to 6.10.0 (#2738)
Bumps com.diffplug.spotless from 6.9.1 to 6.10.0. --- updated-dependencies: - dependency-name: com.diffplug.spotless dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 4b8042e - Browse repository at this point
Copy the full SHA 4b8042eView commit details
Commits on Aug 30, 2022
-
Assign GlobalConfiguration initializer to unused variable (#2742)
(This silences some errorprone static analysis about calling constructors w/o using the new object.)
Configuration menu - View commit details
-
Copy full SHA for 530558a - Browse repository at this point
Copy the full SHA 530558aView commit details
Commits on Sep 5, 2022
-
Explicitly add permissions to GitHub actions (#2744)
Signed-off-by: sashashura <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0753d48 - Browse repository at this point
Copy the full SHA 0753d48View commit details
Commits on Sep 7, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 3e910ea - Browse repository at this point
Copy the full SHA 3e910eaView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v4.7.0...v4.8.0