Commit 97d9c4c
authored
Optimizations for TypeSafeDriverConfig (#1616)
* TypesafeDriverConfig: getProfile can avoid calling containsKey
On a typical applicative workload, 0.53% of CPU is spend resolving
configuration profiles. By getting the profile first and failing if it
is null we can easily cut that in half.
* TypesafeDriverConfig: optimize getDefaultProfile
We could easily get a dedicated field for the default profile thus
avoiding recurring maps lookups.
* fixup! TypesafeDriverConfig: optimize getDefaultProfile1 parent a40bbc2 commit 97d9c4c
2 files changed
Lines changed: 22 additions & 5 deletions
File tree
- core/src
- main/java/com/datastax/oss/driver/internal/core/config/typesafe
- test/java/com/datastax/oss/driver/internal/core/config/typesafe
core/src/main/java/com/datastax/oss/driver/internal/core/config/typesafe/TypesafeDriverConfig.java
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
139 | 148 | | |
140 | 149 | | |
141 | 150 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
174 | 182 | | |
175 | 183 | | |
176 | 184 | | |
| |||
0 commit comments