Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
projet-part2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mamadu-lamarana Bah
projet-part2
Commits
2a727e3c
Commit
2a727e3c
authored
1 year ago
by
Mamadu-lamarana Bah
Browse files
Options
Downloads
Patches
Plain Diff
suppression de la fonction de timeBagOfPrimitivesStreaming
parent
ac838b88
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gson/metrics/src/main/java/com/google/gson/metrics/BagOfPrimitivesDeserializationBenchmark.java
+1
-30
1 addition, 30 deletions
...gson/metrics/BagOfPrimitivesDeserializationBenchmark.java
with
1 addition
and
30 deletions
gson/metrics/src/main/java/com/google/gson/metrics/BagOfPrimitivesDeserializationBenchmark.java
+
1
−
30
View file @
2a727e3c
...
...
@@ -50,36 +50,7 @@ public class BagOfPrimitivesDeserializationBenchmark {
gson
.
fromJson
(
json
,
BagOfPrimitives
.
class
);
}
}
/** Benchmark to measure deserializing objects by hand */
public
void
timeBagOfPrimitivesStreaming
(
int
reps
)
throws
IOException
{
for
(
int
i
=
0
;
i
<
reps
;
++
i
)
{
StringReader
reader
=
new
StringReader
(
json
);
JsonReader
jr
=
new
JsonReader
(
reader
);
jr
.
beginObject
();
long
longValue
=
0
;
int
intValue
=
0
;
boolean
booleanValue
=
false
;
String
stringValue
=
null
;
while
(
jr
.
hasNext
())
{
String
name
=
jr
.
nextName
();
if
(
name
.
equals
(
"longValue"
))
{
longValue
=
jr
.
nextLong
();
}
else
if
(
name
.
equals
(
"intValue"
))
{
intValue
=
jr
.
nextInt
();
}
else
if
(
name
.
equals
(
"booleanValue"
))
{
booleanValue
=
jr
.
nextBoolean
();
}
else
if
(
name
.
equals
(
"stringValue"
))
{
stringValue
=
jr
.
nextString
();
}
else
{
throw
new
IOException
(
"Unexpected name: "
+
name
);
}
}
jr
.
endObject
();
new
BagOfPrimitives
(
longValue
,
intValue
,
booleanValue
,
stringValue
);
}
}
/**
* This benchmark measures the ideal Gson performance: the cost of parsing a JSON stream and
* setting object values by reflection. We should strive to reduce the discrepancy between this
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment