@@ -82,7 +82,7 @@ int main(int argc, char *argv[]) {
8282 std::cout << p.size () << " B " ;
8383 std::cout << std::endl;
8484 }
85- char *buffer = allocate_padded_buffer (p.size () + 1 );
85+ char *buffer = simdjson:: allocate_padded_buffer (p.size () + 1 );
8686 memcpy (buffer, p.data (), p.size ());
8787 buffer[p.size ()] = ' \0 ' ;
8888
@@ -101,12 +101,12 @@ int main(int argc, char *argv[]) {
101101 memcpy (buffer, p.data (), p.size ());
102102
103103 size_t outlength =
104- jsonminify ((const uint8_t *)buffer, p.size (), (uint8_t *)buffer);
104+ simdjson:: jsonminify ((const uint8_t *)buffer, p.size (), (uint8_t *)buffer);
105105 if (verbose)
106106 std::cout << " jsonminify length is " << outlength << std::endl;
107107
108108 uint8_t *cbuffer = (uint8_t *)buffer;
109- BEST_TIME (" jsonminify" , jsonminify (cbuffer, p.size (), cbuffer), outlength,
109+ BEST_TIME (" jsonminify" , simdjson:: jsonminify (cbuffer, p.size (), cbuffer), outlength,
110110 memcpy (buffer, p.data (), p.size ()), repeat, volume, !justdata);
111111 printf (" minisize = %zu, original size = %zu (minified down to %.2f percent of original) \n " , outlength, p.size (), outlength * 100.0 / p.size ());
112112
@@ -117,8 +117,8 @@ int main(int argc, char *argv[]) {
117117 BEST_TIME (" RapidJSON Insitu orig" , d.ParseInsitu (buffer).HasParseError (), false ,
118118 memcpy (buffer, p.data (), p.size ()), repeat, volume, !justdata);
119119
120- char *minibuffer = allocate_padded_buffer (p.size () + 1 );
121- size_t minisize = jsonminify ((const uint8_t *)p.data (), p.size (), (uint8_t *) minibuffer);
120+ char *minibuffer = simdjson:: allocate_padded_buffer (p.size () + 1 );
121+ size_t minisize = simdjson:: jsonminify ((const uint8_t *)p.data (), p.size (), (uint8_t *) minibuffer);
122122 minibuffer[minisize] = ' \0 ' ;
123123
124124 BEST_TIME (" RapidJSON Insitu despaced" , d.ParseInsitu (buffer).HasParseError (), false ,
@@ -133,23 +133,23 @@ int main(int argc, char *argv[]) {
133133
134134 BEST_TIME (" sajson despaced" , sajson::parse (sajson::bounded_allocation (ast_buffer, astbuffersize), sajson::mutable_string_view (minisize, buffer)).is_valid (), true , memcpy (buffer, minibuffer, p.size ()), repeat, volume, !justdata);
135135
136- ParsedJson pj;
136+ simdjson:: ParsedJson pj;
137137 bool isallocok = pj.allocateCapacity (p.size (), 1024 );
138138 if (!isallocok) {
139139 fprintf (stderr, " failed to allocate memory\n " );
140140 return EXIT_FAILURE;
141141 }
142142 bool automated_reallocation = false ;
143- BEST_TIME (" simdjson orig" , json_parse ((const uint8_t *)buffer, p.size (), pj, automated_reallocation), true , memcpy (buffer, p.data (), p.size ()), repeat, volume, !justdata);
143+ BEST_TIME (" simdjson orig" , simdjson:: json_parse ((const uint8_t *)buffer, p.size (), pj, automated_reallocation), true , memcpy (buffer, p.data (), p.size ()), repeat, volume, !justdata);
144144
145- ParsedJson pj2;
145+ simdjson:: ParsedJson pj2;
146146 bool isallocok2 = pj2.allocateCapacity (p.size (), 1024 );
147147 if (!isallocok2) {
148148 fprintf (stderr, " failed to allocate memory\n " );
149149 return EXIT_FAILURE;
150150 }
151151 automated_reallocation = false ;
152- BEST_TIME (" simdjson despaced" , json_parse ((const uint8_t *)buffer, minisize, pj2, automated_reallocation), true , memcpy (buffer, minibuffer, p.size ()), repeat, volume, !justdata);
152+ BEST_TIME (" simdjson despaced" , simdjson:: json_parse ((const uint8_t *)buffer, minisize, pj2, automated_reallocation), true , memcpy (buffer, minibuffer, p.size ()), repeat, volume, !justdata);
153153 free (buffer);
154154 free (ast_buffer);
155155 free (minibuffer);
0 commit comments