├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── bench_collect_results.py ├── bench_plot_results.py ├── benchmark-src ├── Makefile ├── README.md ├── _itoa.h ├── bench-malloc-thread.c ├── bench-timing.h ├── hp-timing-common.h ├── hp-timing.h ├── json-lib.c └── json-lib.h └── results ├── 2018-02-11-desktop-corei5 ├── glibc-results.json ├── hardware-inventory.txt ├── jemalloc-results.json ├── results.png ├── system_default-results.json └── tcmalloc-results.json ├── 2018-02-11-desktop-xeon3470 ├── glibc-results.json ├── hardware-inventory.txt ├── jemalloc-results.json ├── results.png ├── system_default-results.json └── tcmalloc-results.json ├── 2018-02-11-server-xeon2680 ├── hardware-inventory.txt ├── jemalloc-results.json ├── results.png ├── system_default-results.json └── tcmalloc-results.json └── 2018-03-17-server-xeon2680 ├── hardware-inventory.txt ├── jemalloc-results.json ├── results.png ├── system_default-results.json └── tcmalloc-results.json /.gitignore: -------------------------------------------------------------------------------- 1 | benchmark-src/bench-malloc-thread 2 | benchmark-src/*.o 3 | glibc-build/ 4 | glibc-install/ 5 | glibc/ 6 | gperftools/ 7 | jemalloc-install/ 8 | jemalloc/ 9 | tcmalloc-install/ 10 | *.json 11 | *.png 12 | .cproject 13 | .project 14 | .pydevproject 15 | 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 489 | 490 | Also add information on how to contact you by electronic and paper mail. 491 | 492 | You should also get your employer (if you work as a programmer) or your 493 | school, if any, to sign a "copyright disclaimer" for the library, if 494 | necessary. Here is a sample; alter the names: 495 | 496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 498 | 499 | , 1 April 1990 500 | Ty Coon, President of Vice 501 | 502 | That's all there is to it! 503 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # This makefile will build a small benchmarking utility for 'malloc' implementations and will 3 | # run it with different implementations saving results into JSON files. 4 | # 5 | # Specifically this makefile downloads, configure and compiles 3 different software packages: 6 | # - GNU libc 7 | # - Google perftools (tcmalloc) 8 | # - jemalloc 9 | # 10 | # Tested with versions: 11 | # - GNU libc 2.26 12 | # - Google perftools (tcmalloc) 2.6.3 13 | # - jemalloc 5.0.1 14 | # 15 | # 16 | 17 | # 18 | # Parameters from command line 19 | # 20 | 21 | ifdef NTHREADS 22 | benchmark_nthreads := $(NTHREADS) 23 | else 24 | # default value 25 | benchmark_nthreads := 1 2 4 8 16 26 | endif 27 | 28 | ifdef CLONE_FROM_GIT 29 | use_git := $(CLONE_FROM_GIT) 30 | else 31 | # default value 32 | use_git := 1 33 | endif 34 | 35 | ifdef NUMPROC 36 | parallel_flags := -j$(NUMPROC) 37 | else 38 | # default value 39 | parallel_flags := -j4 40 | endif 41 | 42 | ifdef POSTFIX 43 | benchmark_postfix := $(POSTFIX) 44 | else 45 | # default value 46 | benchmark_postfix := $(shell hostname) 47 | endif 48 | 49 | ifdef RESULT_DIRNAME 50 | results_dir := $(RESULT_DIRNAME) 51 | else 52 | # default value 53 | results_dir := results/$(shell date +%F)-$(benchmark_postfix) 54 | endif 55 | 56 | ifdef IMPLEMENTATIONS 57 | implem_list := $(IMPLEMENTATIONS) 58 | else 59 | # default value 60 | implem_list := system_default glibc tcmalloc jemalloc 61 | endif 62 | 63 | 64 | 65 | 66 | # 67 | # Constants 68 | # 69 | 70 | topdir=$(shell readlink -f .) 71 | 72 | benchmark_result_json := results.json 73 | benchmark_result_png := results.png 74 | 75 | glibc_url := git://sourceware.org/git/glibc.git 76 | tcmalloc_url := https://github.com/gperftools/gperftools.git 77 | jemalloc_url := https://github.com/jemalloc/jemalloc.git 78 | 79 | glibc_version := 2.26 80 | glibc_alt_wget_url := https://ftpmirror.gnu.org/libc/glibc-$(glibc_version).tar.xz 81 | 82 | glibc_build_dir := $(topdir)/glibc-build 83 | glibc_install_dir := $(topdir)/glibc-install 84 | tcmalloc_install_dir := $(topdir)/tcmalloc-install 85 | jemalloc_install_dir := $(topdir)/jemalloc-install 86 | 87 | 88 | # 89 | # Functions 90 | # 91 | 92 | # 93 | # Targets 94 | # 95 | 96 | .PHONY: all download build collect_results plot_results upload_results 97 | 98 | all: download build collect_results plot_results 99 | 100 | download: 101 | @echo "Downloading [$(implem_list)] malloc implementations" 102 | ifeq ($(findstring glibc,$(implem_list)),glibc) 103 | ifeq ($(use_git),1) 104 | @[ ! -d glibc ] && git clone $(glibc_url) || echo "glibc GIT repo seems to be already there" 105 | else 106 | @[ ! -d glibc ] && ( wget $(glibc_alt_wget_url) && tar xvf glibc-$(glibc_version).tar.xz && mv glibc-$(glibc_version) glibc ) || echo "glibc GIT repo seems to be already there" 107 | endif 108 | endif 109 | ifeq ($(findstring tcmalloc,$(implem_list)),tcmalloc) 110 | @[ ! -d gperftools ] && git clone $(tcmalloc_url) || echo "Google perftools GIT repo seems to be already there" 111 | endif 112 | ifeq ($(findstring jemalloc,$(implem_list)),jemalloc) 113 | @[ ! -d jemalloc ] && git clone $(jemalloc_url) || echo "Jemalloc GIT repo seems to be already there" 114 | endif 115 | 116 | 117 | # 118 | # A couple of notes about GNU libc: 119 | # 1) building in source dir is not supported... that's why we build in separate folder 120 | # 2) building only benchmark utilities is not supported... that's why we build everything 121 | # 122 | $(glibc_install_dir)/lib/libc.so.6: 123 | @echo "Building GNU libc... go get a cup of coffee... this will take time!" 124 | mkdir -p $(glibc_build_dir) 125 | cd $(glibc_build_dir) && \ 126 | ../glibc/configure --prefix=$(glibc_install_dir) && \ 127 | make $(parallel_flags) && \ 128 | make install 129 | [ -x $(glibc_build_dir)/benchtests/bench-malloc-thread ] && echo "GNU libc benchmarking utility is ready!" || echo "Cannot find GNU libc benchmarking utility! Cannot collect benchmark results" 130 | 131 | $(tcmalloc_install_dir)/lib/libtcmalloc.so: 132 | cd gperftools && \ 133 | ./autogen.sh && \ 134 | ./configure --prefix=$(tcmalloc_install_dir) && \ 135 | make && \ 136 | make install 137 | 138 | $(jemalloc_install_dir)/lib/libjemalloc.so: 139 | cd jemalloc && \ 140 | ./autogen.sh && \ 141 | ./configure --prefix=$(jemalloc_install_dir) && \ 142 | make && \ 143 | ( make install || true ) 144 | 145 | build: 146 | $(MAKE) -C benchmark-src 147 | ifeq ($(findstring glibc,$(implem_list)),glibc) 148 | $(MAKE) $(glibc_install_dir)/lib/libc.so.6 149 | endif 150 | ifeq ($(findstring tcmalloc,$(implem_list)),tcmalloc) 151 | $(MAKE) $(tcmalloc_install_dir)/lib/libtcmalloc.so 152 | endif 153 | ifeq ($(findstring jemalloc,$(implem_list)),jemalloc) 154 | $(MAKE) $(jemalloc_install_dir)/lib/libjemalloc.so 155 | endif 156 | @echo "Congrats! Successfully built all [$(implem_list)] malloc implementations to test." 157 | 158 | collect_results: 159 | @mkdir -p $(results_dir) 160 | @echo "Starting to collect performance benchmarks." 161 | ./bench_collect_results.py "$(implem_list)" $(results_dir)/$(benchmark_result_json) $(benchmark_nthreads) 162 | @echo "Collecting hardware information in $(results_dir)/hardware-inventory.txt" 163 | @sudo lshw -short -class memory -class processor > $(results_dir)/hardware-inventory.txt 164 | @echo -n "Number of CPU cores: " >>$(results_dir)/hardware-inventory.txt 165 | @grep "processor" /proc/cpuinfo | wc -l >>$(results_dir)/hardware-inventory.txt 166 | @(which numactl >/dev/null 2>&1) && echo "NUMA informations:" >>$(results_dir)/hardware-inventory.txt 167 | @(which numactl >/dev/null 2>&1) && numactl -H >>$(results_dir)/hardware-inventory.txt 168 | 169 | plot_results: 170 | ./bench_plot_results.py $(results_dir)/$(benchmark_result_png) $(results_dir)/*.json 171 | 172 | # the following target is mostly useful only to the maintainer of the github project: 173 | upload_results: 174 | git add -f $(results_dir)/*$(benchmark_result_json) $(results_dir)/$(benchmark_result_png) $(results_dir)/hardware-inventory.txt 175 | git commit -m "Adding results from folder $(results_dir) to the GIT repository" 176 | @echo "Run 'git push' to push online your results (required GIT repo write access)" 177 | 178 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # malloc-benchmarks 2 | 3 | Simple benchmarking scripts to run on any machine to compare different C/C++ malloc implementations. 4 | The scripts are not meant to face any possible problem, quite the opposite. 5 | They will: 6 | - download and build [GNU libc](https://www.gnu.org/software/libc/), [Google perftools](https://github.com/gperftools/gperftools), [Jemalloc](http://jemalloc.net/) 7 | - use GNU libc malloc multi-thread benchmarking utility to generate JSON results for different combinations 8 | of malloc implementation and number of threads 9 | - use [Python matplotlib](https://matplotlib.org/) to produce a summary figure 10 | 11 | 12 | ## How to collect benchmark results and view them 13 | 14 | ``` 15 | git clone https://github.com/f18m/malloc-benchmarks.git 16 | cd malloc-benchmarks 17 | make 18 | ``` 19 | 20 | 21 | ## How to collect benchmark results on a machine and plot them from another one 22 | 23 | On the machine where you want to collect benchmark results: 24 | 25 | ``` 26 | git clone https://github.com/f18m/malloc-benchmarks.git 27 | cd malloc-benchmarks 28 | make download build collect_results 29 | scp -r results IP_OF_OTHER_MACHINE: 30 | ``` 31 | 32 | On the other machine where you want to plot results: 33 | 34 | ``` 35 | git clone https://github.com/f18m/malloc-benchmarks.git 36 | cd malloc-benchmarks 37 | mv ../results . 38 | make plot_results 39 | ``` 40 | 41 | 42 | ## Example benchmarks 43 | 44 | The following are some pictures obtained on different HW systems using however the same benchmarking utility written by 45 | GNU libc developers. They give an idea on how much performances can be different on different CPU/memory HW and varying the number of threads. 46 | Of course the closer the curves are to zero, the better they are (the lower the better!). 47 | 48 | 49 | 50 | 51 | 52 | 53 | 58 | 70 | 71 | 72 | 73 | 74 | 79 | 91 | 92 | 93 | 94 | 95 | 100 | 112 | 113 | 114 | 115 | 116 |
54 | 55 | ![](results/2018-02-11-desktop-corei5/results.png "Malloc speed measured on 4-core Intel Core i5 CPU") 56 | 57 | 59 | 60 | Relevant HW information of machine used for testing available [here](results/2018-02-11-desktop-corei5/hardware-inventory.txt) 61 | 62 | 'system_default' is GNU libc version 2.23 (default for Ubuntu 16.04 LTS) 63 | 64 | 'glibc' is GNU libc version 2.26 65 | 66 | 'tcmalloc' is Google gperftools version 2.6.3 67 | 68 | 'jemalloc' is Google gperftools version 5.0.1 69 |
75 | 76 | ![](results/2018-02-11-desktop-xeon3470/results.png "Malloc speed measured on 8-core Intel Xeon 3470 CPU") 77 | 78 | 80 | 81 | Relevant HW information of machine used for testing available [here](results/2018-02-11-desktop-xeon3470/hardware-inventory.txt) 82 | 83 | 'system_default' is GNU libc version 2.23 (default for Ubuntu 16.04 LTS) 84 | 85 | 'glibc' is GNU libc version 2.26 86 | 87 | 'tcmalloc' is Google gperftools version 2.6.3 88 | 89 | 'jemalloc' is Google gperftools version 5.0.1 90 |
96 | 97 | ![](results/2018-03-17-server-xeon2680/results.png "Malloc speed measured on 40-core dual-CPU Intel Xeon 2680 CPU") 98 | 99 | 101 | 102 | Relevant HW information of machine used for testing available [here](results/2018-03-17-server-xeon2680/hardware-inventory.txt) 103 | 104 | 'system_default' is GNU libc version 2.17 (default for Centos 7) 105 | 106 | 'glibc' curve is missing: the default GCC of Centos 7 is too old to build a recent GNU libc version. 107 | 108 | 'tcmalloc' is Google gperftools version 2.6.3 109 | 110 | 'jemalloc' is Google gperftools version 5.0.1 111 |
117 | 118 | 119 | ## Contribute your own benchmarks 120 | 121 | If you would like to contribute your benchmarks running on different hardware please 122 | contact me at francesco DOT montorsi AT gmail DOT com. 123 | Thanks. 124 | 125 | -------------------------------------------------------------------------------- /bench_collect_results.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """Generate benchmarking results in JSON form, using GNU libc benchmarking utility; 3 | different allocators are injected into that utility by using LD_PRELOAD trick. 4 | """ 5 | import sys 6 | import os 7 | import json 8 | import subprocess 9 | 10 | # 11 | # Constants 12 | # 13 | 14 | internal_benchmark_util = 'benchmark-src/bench-malloc-thread' 15 | 16 | glibc_install_dir = 'glibc-install' 17 | tcmalloc_install_dir = 'tcmalloc-install' 18 | jemalloc_install_dir = 'jemalloc-install' 19 | 20 | impl_preload_libs = { 21 | 'system_default':'', 22 | 'glibc': '', 23 | 24 | # to test tcmalloc and jemalloc implementations we simply use the LD_PRELOAD trick: 25 | 'tcmalloc': tcmalloc_install_dir + '/lib/libtcmalloc.so', 26 | 'jemalloc': jemalloc_install_dir + '/lib/libjemalloc.so' 27 | } 28 | 29 | # to successfully preload the tcmalloc,jemalloc libs we will also need to preload the C++ standard lib and gcc_s lib: 30 | preload_required_libs= [ 'libstdc++.so.6', 'libgcc_s.so.1' ] 31 | preload_required_libs_fullpaths = [] 32 | 33 | benchmark_util = { 34 | 'system_default': internal_benchmark_util, 35 | 36 | # to test the latest GNU libc implementation downloaded and compiled locally we use another trick: 37 | # we ask the dynamic linker of the just-built GNU libc to run the benchmarking utility using new GNU libc dyn libs: 38 | 'glibc': glibc_install_dir + '/lib/ld-linux-x86-64.so.2 --library-path ' + glibc_install_dir + '/lib ' + internal_benchmark_util, 39 | 40 | 'tcmalloc': internal_benchmark_util, 41 | 'jemalloc': internal_benchmark_util 42 | } 43 | 44 | def find(name, paths): 45 | for path in paths: 46 | #print "Searching into: ", path 47 | for root, dirs, files in os.walk(path, followlinks=False): 48 | if name in files: 49 | return os.path.join(root, name) 50 | return "" 51 | 52 | def find_no_symlink(name, paths): 53 | matching_filepath = find(name, paths) 54 | if len(matching_filepath)==0: 55 | return '' 56 | 57 | # is the result a symlink? 58 | while os.path.islink(matching_filepath): 59 | result = os.readlink(matching_filepath) 60 | matching_filepath = os.path.join(os.path.dirname(matching_filepath), result) 61 | return matching_filepath 62 | 63 | def check_requirements(): 64 | global preload_required_libs_fullpaths, impl_preload_libs, benchmark_util 65 | 66 | # for util in benchmark_util.values(): 67 | # if not os.path.isfile(util): 68 | # print("Could not find required benchmarking utility {}".format(util)) 69 | # sys.exit(2) 70 | # print("Found required benchmarking utility {}".format(util)) 71 | if not os.path.isfile(internal_benchmark_util): 72 | print("Could not find required benchmarking utility {}".format(internal_benchmark_util)) 73 | sys.exit(2) 74 | print("Found required benchmarking utility {}".format(internal_benchmark_util)) 75 | 76 | for preloadlib in impl_preload_libs.values(): 77 | if len(preloadlib)>0: 78 | if not os.path.isfile(preloadlib): 79 | print("Could not find required lib {}".format(preloadlib)) 80 | sys.exit(2) 81 | print("Found required lib {}".format(preloadlib)) 82 | 83 | for reqlib in preload_required_libs: 84 | full_path = find_no_symlink(reqlib, ['/usr/lib', '/lib', '/lib64']) 85 | if len(full_path)==0: 86 | print("Could not find required shared library {}".format(reqlib)) 87 | sys.exit(2) 88 | print("Found required lib {}".format(full_path)) 89 | preload_required_libs_fullpaths.append(full_path) 90 | 91 | def run_benchmark(outfile,thread_values,impl_name): 92 | global preload_required_libs_fullpaths, impl_preload_libs 93 | 94 | if impl_name not in impl_preload_libs: 95 | print("Unknown settings required for testing implementation {}".format(impl_name)) 96 | sys.exit(3) 97 | 98 | of = open(outfile, 'w') 99 | of.write('[') 100 | 101 | success = 0 102 | last_nthreads = thread_values[len(thread_values)-1] 103 | bm = {} 104 | for nthreads in thread_values: 105 | 106 | try: 107 | os.environ["LD_PRELOAD"] = impl_preload_libs[impl_name] 108 | if len(os.environ["LD_PRELOAD"])>0: 109 | # the tcmalloc/jemalloc shared libs require in turn C++ libs: 110 | #print "preload_required_libs_fullpaths is:", preload_required_libs_fullpaths 111 | for lib in preload_required_libs_fullpaths: 112 | os.environ["LD_PRELOAD"] = os.environ["LD_PRELOAD"] + ':' + lib 113 | 114 | utility_fname = benchmark_util[impl_name] 115 | 116 | 117 | # run the external benchmark utility with the LD_PRELOAD trick 118 | print("Running for nthreads={}:\n LD_PRELOAD='{}' {} {}".format(nthreads,os.environ["LD_PRELOAD"],utility_fname,nthreads)) 119 | 120 | # the subprocess.check_output() method does not seem to work fine when launching 121 | # the ld-linux-x86-64.so.2 with --library-path 122 | #stdout = subprocess.check_output([utility_fname, nthreads]) 123 | os.system("{} {} >/tmp/benchmark-output".format(utility_fname,nthreads)) 124 | stdout = open('/tmp/benchmark-output', 'r').read() 125 | 126 | # produce valid JSON output: 127 | of.write(stdout) 128 | if nthreads != last_nthreads: 129 | of.write(',') 130 | success=success+1 131 | 132 | except OSError as ex: 133 | print("Failed running malloc benchmarking utility: {}. Skipping.".format(ex)) 134 | 135 | of.write(']\n') 136 | return success 137 | 138 | def main(args): 139 | """Program Entry Point 140 | """ 141 | if len(args) < 2: 142 | print('Usage: %s ...' % sys.argv[0]) 143 | sys.exit(os.EX_USAGE) 144 | 145 | # parse args 146 | implementations = args[0].split() 147 | outfile_path_prefix,outfile_postfix = os.path.split(args[1]) 148 | thread_values = args[2:] 149 | 150 | check_requirements() 151 | 152 | success = 0 153 | for idx in range(0,len(implementations)): 154 | if implementations[idx] not in impl_preload_libs: 155 | print("Unknown settings required for testing implementation '{}'".format(implementations[idx])) 156 | sys.exit(3) 157 | 158 | outfile = os.path.join(outfile_path_prefix, implementations[idx] + '-' + outfile_postfix) 159 | print "----------------------------------------------------------------------------------------------" 160 | print "Testing implementation '{}'. Saving results into '{}'".format(implementations[idx],outfile) 161 | 162 | print "Will run tests for {} different number of threads".format(len(thread_values)) 163 | success = success + run_benchmark(outfile,thread_values,implementations[idx]) 164 | 165 | print "----------------------------------------------------------------------------------------------" 166 | return success 167 | 168 | if __name__ == '__main__': 169 | success = main(sys.argv[1:]) 170 | if success==0: 171 | sys.exit(1) 172 | 173 | -------------------------------------------------------------------------------- /bench_plot_results.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """Generates a figure that shows all benchmarking results 3 | """ 4 | import sys 5 | import os 6 | import json 7 | import collections 8 | 9 | import matplotlib.pyplot as plotlib 10 | 11 | BenchmarkPoint = collections.namedtuple('BenchmarkPoint', ['threads', 'time_per_iteration'], verbose=False) 12 | filled_markers = ('o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X') 13 | colours = ('r', 'g', 'b', 'black', 'yellow', 'purple') 14 | 15 | def plot_graphs(outfilename, benchmark_dict): 16 | """Plots the given dictionary of benchmark results 17 | """ 18 | plotlib.clf() 19 | plotlib.xlabel('Number of threads') 20 | plotlib.ylabel('CPU cycles per malloc op') # bench-malloc-thread uses RDTSC counter for reporting time => CPU clock cycles 21 | 22 | nmarker=0 23 | max_x=[] 24 | max_y=[] 25 | for impl_name in benchmark_dict.keys(): 26 | current_bm = benchmark_dict[impl_name] 27 | 28 | # add a line plot 29 | X = [ x.threads for x in current_bm ] 30 | Y = [ y.time_per_iteration for y in current_bm ] 31 | lines = plotlib.plot(X, Y, '-' + filled_markers[nmarker], label=impl_name) 32 | plotlib.setp(lines, 'color', colours[nmarker]) 33 | 34 | # remember max X/Y 35 | max_x.append(max(X)) 36 | max_y.append(max(Y)) 37 | 38 | nmarker=nmarker+1 39 | 40 | # set some graph global props: 41 | plotlib.xlim(0, max(max_x)*1.1) 42 | plotlib.ylim(0, max(max_y)*1.3) 43 | 44 | print("Writing plot into '%s'" % outfilename) 45 | plotlib.legend(loc='upper left') 46 | plotlib.savefig(outfilename) 47 | plotlib.show() 48 | 49 | 50 | def main(args): 51 | """Program Entry Point 52 | """ 53 | if len(args) < 2: 54 | print('Usage: %s ...' % sys.argv[0]) 55 | sys.exit(os.EX_USAGE) 56 | 57 | bm = {} 58 | for filepath in args[1:]: 59 | print("Parsing '{}'...".format(filepath)) 60 | with open(filepath, 'r') as benchfile: 61 | filename = os.path.basename(filepath) 62 | 63 | try: 64 | bench_list = json.load(benchfile) 65 | except Exception as ex: 66 | print("Invalid JSON file {}: {}".format(filepath, ex)) 67 | sys.exit(2) 68 | #print json.dumps(bench_list, sort_keys=True, indent=4, separators=(',', ': ')) 69 | 70 | bm[filename] = [] 71 | for bench in bench_list: 72 | bm[filename].append(BenchmarkPoint(bench['functions']['malloc']['']['threads'], bench['functions']['malloc']['']['time_per_iteration'])) 73 | 74 | print('Found {} data points in {}...'.format(len(bm[filename]), filepath)) 75 | 76 | plot_graphs(args[0], bm) 77 | 78 | if __name__ == '__main__': 79 | main(sys.argv[1:]) 80 | 81 | 82 | -------------------------------------------------------------------------------- /benchmark-src/Makefile: -------------------------------------------------------------------------------- 1 | TARGET = bench-malloc-thread 2 | LIBS = -lpthread 3 | CC = gcc 4 | CFLAGS = -g -Wall -O2 -std=gnu99 5 | 6 | .PHONY: default all clean 7 | 8 | default: $(TARGET) 9 | 10 | all: default 11 | 12 | OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c)) 13 | HEADERS = $(wildcard *.h) 14 | 15 | %.o: %.c $(HEADERS) 16 | $(CC) $(CFLAGS) -c $< -o $@ 17 | 18 | .PRECIOUS: $(TARGET) $(OBJECTS) 19 | 20 | $(TARGET): $(OBJECTS) 21 | $(CC) $(OBJECTS) -Wall $(LIBS) -o $@ 22 | 23 | clean: 24 | -rm -f *.o 25 | -rm -f $(TARGET) 26 | -------------------------------------------------------------------------------- /benchmark-src/README.md: -------------------------------------------------------------------------------- 1 | # Benchmark utility sources 2 | 3 | The sources collected here are a small subset of GNU libc benchmarking utility for 'malloc' implementations. 4 | Please see glibc/benchtests/bech-malloc-thread.c for the most up-to-date source code. 5 | -------------------------------------------------------------------------------- /benchmark-src/_itoa.h: -------------------------------------------------------------------------------- 1 | /* Internal function for converting integers to ASCII. 2 | Copyright (C) 1994-2017 Free Software Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with the GNU C Library; if not, see 17 | . */ 18 | 19 | #ifndef _ITOA_H 20 | #define _ITOA_H 21 | 22 | #include 23 | 24 | /* When long long is different from long, by default, _itoa_word is 25 | provided to convert long to ASCII and _itoa is provided to convert 26 | long long. A sysdeps _itoa.h can define _ITOA_NEEDED to 0 and define 27 | _ITOA_WORD_TYPE to unsigned long long int to override it so that 28 | _itoa_word is changed to convert long long to ASCII and _itoa is 29 | mapped to _itoa_word. */ 30 | 31 | #ifndef _ITOA_NEEDED 32 | # define _ITOA_NEEDED (LONG_MAX != LLONG_MAX) 33 | #endif 34 | #ifndef _ITOA_WORD_TYPE 35 | # define _ITOA_WORD_TYPE unsigned long int 36 | #endif 37 | 38 | #define attribute_hidden /* empty macro */ 39 | #define IS_IN(x) 0 40 | 41 | /* Convert VALUE into ASCII in base BASE (2..36). 42 | Write backwards starting the character just before BUFLIM. 43 | Return the address of the first (left-to-right) character in the number. 44 | Use upper case letters iff UPPER_CASE is nonzero. */ 45 | 46 | extern char *_itoa (unsigned long long int value, char *buflim, 47 | unsigned int base, int upper_case) attribute_hidden; 48 | 49 | extern const char _itoa_upper_digits[]; 50 | extern const char _itoa_lower_digits[]; 51 | #if IS_IN (libc) || IS_IN (rtld) 52 | hidden_proto (_itoa_upper_digits) 53 | hidden_proto (_itoa_lower_digits) 54 | #endif 55 | 56 | #if IS_IN (libc) 57 | extern char *_itoa_word (_ITOA_WORD_TYPE value, char *buflim, 58 | unsigned int base, 59 | int upper_case) attribute_hidden; 60 | #else 61 | static inline char * __attribute__ ((unused, always_inline)) 62 | _itoa_word (_ITOA_WORD_TYPE value, char *buflim, 63 | unsigned int base, int upper_case) 64 | { 65 | const char *digits = (upper_case 66 | ? _itoa_upper_digits 67 | : _itoa_lower_digits); 68 | 69 | switch (base) 70 | { 71 | # define SPECIAL(Base) \ 72 | case Base: \ 73 | do \ 74 | *--buflim = digits[value % Base]; \ 75 | while ((value /= Base) != 0); \ 76 | break 77 | 78 | SPECIAL (10); 79 | SPECIAL (16); 80 | SPECIAL (8); 81 | default: 82 | do 83 | *--buflim = digits[value % base]; 84 | while ((value /= base) != 0); 85 | } 86 | return buflim; 87 | } 88 | # undef SPECIAL 89 | #endif 90 | 91 | /* Similar to the _itoa functions, but output starts at buf and pointer 92 | after the last written character is returned. */ 93 | extern char *_fitoa_word (_ITOA_WORD_TYPE value, char *buf, 94 | unsigned int base, 95 | int upper_case) attribute_hidden; 96 | extern char *_fitoa (unsigned long long value, char *buf, unsigned int base, 97 | int upper_case) attribute_hidden; 98 | 99 | #if !_ITOA_NEEDED 100 | /* No need for special long long versions. */ 101 | # define _itoa(value, buf, base, upper_case) \ 102 | _itoa_word (value, buf, base, upper_case) 103 | # define _fitoa(value, buf, base, upper_case) \ 104 | _fitoa_word (value, buf, base, upper_case) 105 | #endif 106 | 107 | #endif /* itoa.h */ 108 | -------------------------------------------------------------------------------- /benchmark-src/bench-malloc-thread.c: -------------------------------------------------------------------------------- 1 | /* Benchmark malloc and free functions. 2 | Copyright (C) 2013-2017 Free Software Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with the GNU C Library; if not, see 17 | . */ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "bench-timing.h" 31 | #include "json-lib.h" 32 | 33 | /* Benchmark duration in seconds. */ 34 | #define BENCHMARK_DURATION 60 35 | #define RAND_SEED 88 36 | 37 | #ifndef NUM_THREADS 38 | # define NUM_THREADS 1 39 | #endif 40 | 41 | /* Maximum memory that can be allocated at any one time is: 42 | 43 | NUM_THREADS * WORKING_SET_SIZE * MAX_ALLOCATION_SIZE 44 | 45 | However due to the distribution of the random block sizes 46 | the typical amount allocated will be much smaller. */ 47 | #define WORKING_SET_SIZE 1024 48 | 49 | #define MIN_ALLOCATION_SIZE 4 50 | #define MAX_ALLOCATION_SIZE 32768 51 | 52 | /* Get a random block size with an inverse square distribution. */ 53 | static unsigned int 54 | get_block_size (unsigned int rand_data) 55 | { 56 | /* Inverse square. */ 57 | const float exponent = -2; 58 | /* Minimum value of distribution. */ 59 | const float dist_min = MIN_ALLOCATION_SIZE; 60 | /* Maximum value of distribution. */ 61 | const float dist_max = MAX_ALLOCATION_SIZE; 62 | 63 | float min_pow = powf (dist_min, exponent + 1); 64 | float max_pow = powf (dist_max, exponent + 1); 65 | 66 | float r = (float) rand_data / RAND_MAX; 67 | 68 | return (unsigned int) powf ((max_pow - min_pow) * r + min_pow, 69 | 1 / (exponent + 1)); 70 | } 71 | 72 | #define NUM_BLOCK_SIZES 8000 73 | #define NUM_OFFSETS ((WORKING_SET_SIZE) * 4) 74 | 75 | static unsigned int random_block_sizes[NUM_BLOCK_SIZES]; 76 | static unsigned int random_offsets[NUM_OFFSETS]; 77 | 78 | static void 79 | init_random_values (void) 80 | { 81 | for (size_t i = 0; i < NUM_BLOCK_SIZES; i++) 82 | random_block_sizes[i] = get_block_size (rand ()); 83 | 84 | for (size_t i = 0; i < NUM_OFFSETS; i++) 85 | random_offsets[i] = rand () % WORKING_SET_SIZE; 86 | } 87 | 88 | static unsigned int 89 | get_random_block_size (unsigned int *state) 90 | { 91 | unsigned int idx = *state; 92 | 93 | if (idx >= NUM_BLOCK_SIZES - 1) 94 | idx = 0; 95 | else 96 | idx++; 97 | 98 | *state = idx; 99 | 100 | return random_block_sizes[idx]; 101 | } 102 | 103 | static unsigned int 104 | get_random_offset (unsigned int *state) 105 | { 106 | unsigned int idx = *state; 107 | 108 | if (idx >= NUM_OFFSETS - 1) 109 | idx = 0; 110 | else 111 | idx++; 112 | 113 | *state = idx; 114 | 115 | return random_offsets[idx]; 116 | } 117 | 118 | static volatile bool timeout; 119 | 120 | static void 121 | alarm_handler (int signum) 122 | { 123 | timeout = true; 124 | } 125 | 126 | /* Allocate and free blocks in a random order. */ 127 | static size_t 128 | malloc_benchmark_loop (void **ptr_arr) 129 | { 130 | unsigned int offset_state = 0, block_state = 0; 131 | size_t iters = 0; 132 | 133 | while (!timeout) 134 | { 135 | unsigned int next_idx = get_random_offset (&offset_state); 136 | unsigned int next_block = get_random_block_size (&block_state); 137 | 138 | free (ptr_arr[next_idx]); 139 | 140 | ptr_arr[next_idx] = malloc (next_block); 141 | 142 | iters++; 143 | } 144 | 145 | return iters; 146 | } 147 | 148 | struct thread_args 149 | { 150 | size_t iters; 151 | void **working_set; 152 | timing_t elapsed; 153 | }; 154 | 155 | static void * 156 | benchmark_thread (void *arg) 157 | { 158 | struct thread_args *args = (struct thread_args *) arg; 159 | size_t iters; 160 | void *thread_set = args->working_set; 161 | timing_t start, stop; 162 | 163 | TIMING_NOW (start); 164 | iters = malloc_benchmark_loop (thread_set); 165 | TIMING_NOW (stop); 166 | 167 | TIMING_DIFF (args->elapsed, start, stop); 168 | args->iters = iters; 169 | 170 | return NULL; 171 | } 172 | 173 | static timing_t 174 | do_benchmark (size_t num_threads, size_t *iters) 175 | { 176 | timing_t elapsed = 0; 177 | 178 | if (num_threads == 1) 179 | { 180 | timing_t start, stop; 181 | void *working_set[WORKING_SET_SIZE]; 182 | 183 | memset (working_set, 0, sizeof (working_set)); 184 | 185 | TIMING_NOW (start); 186 | *iters = malloc_benchmark_loop (working_set); 187 | TIMING_NOW (stop); 188 | 189 | TIMING_DIFF (elapsed, start, stop); 190 | } 191 | else 192 | { 193 | struct thread_args args[num_threads]; 194 | void *working_set[num_threads][WORKING_SET_SIZE]; 195 | pthread_t threads[num_threads]; 196 | 197 | memset (working_set, 0, sizeof (working_set)); 198 | 199 | *iters = 0; 200 | 201 | for (size_t i = 0; i < num_threads; i++) 202 | { 203 | args[i].working_set = working_set[i]; 204 | pthread_create(&threads[i], NULL, benchmark_thread, &args[i]); 205 | } 206 | 207 | for (size_t i = 0; i < num_threads; i++) 208 | { 209 | pthread_join(threads[i], NULL); 210 | TIMING_ACCUM (elapsed, args[i].elapsed); 211 | *iters += args[i].iters; 212 | } 213 | } 214 | return elapsed; 215 | } 216 | 217 | static void usage(const char *name) 218 | { 219 | fprintf (stderr, "%s: \n", name); 220 | exit (1); 221 | } 222 | 223 | int 224 | main (int argc, char **argv) 225 | { 226 | timing_t cur; 227 | size_t iters = 0, num_threads = 1; 228 | unsigned long res; 229 | json_ctx_t json_ctx; 230 | double d_total_s, d_total_i; 231 | struct sigaction act; 232 | 233 | if (argc == 1) 234 | num_threads = 1; 235 | else if (argc == 2) 236 | { 237 | long ret; 238 | 239 | errno = 0; 240 | ret = strtol(argv[1], NULL, 10); 241 | 242 | if (errno || ret == 0) 243 | usage(argv[0]); 244 | 245 | num_threads = ret; 246 | } 247 | else 248 | usage(argv[0]); 249 | 250 | init_random_values (); 251 | 252 | json_init (&json_ctx, 0, stdout); 253 | 254 | json_document_begin (&json_ctx); 255 | 256 | json_attr_string (&json_ctx, "timing_type", TIMING_TYPE); 257 | 258 | json_attr_object_begin (&json_ctx, "functions"); 259 | 260 | json_attr_object_begin (&json_ctx, "malloc"); 261 | 262 | json_attr_object_begin (&json_ctx, ""); 263 | 264 | TIMING_INIT (res); 265 | 266 | (void) res; 267 | 268 | memset (&act, 0, sizeof (act)); 269 | act.sa_handler = &alarm_handler; 270 | 271 | sigaction (SIGALRM, &act, NULL); 272 | 273 | alarm (BENCHMARK_DURATION); 274 | 275 | cur = do_benchmark (num_threads, &iters); 276 | 277 | struct rusage usage; 278 | getrusage(RUSAGE_SELF, &usage); 279 | 280 | d_total_s = cur; 281 | d_total_i = iters; 282 | 283 | json_attr_double (&json_ctx, "duration", d_total_s); 284 | json_attr_double (&json_ctx, "iterations", d_total_i); 285 | json_attr_double (&json_ctx, "time_per_iteration", d_total_s / d_total_i); 286 | json_attr_double (&json_ctx, "max_rss", usage.ru_maxrss); 287 | 288 | json_attr_double (&json_ctx, "threads", num_threads); 289 | json_attr_double (&json_ctx, "min_size", MIN_ALLOCATION_SIZE); 290 | json_attr_double (&json_ctx, "max_size", MAX_ALLOCATION_SIZE); 291 | json_attr_double (&json_ctx, "random_seed", RAND_SEED); 292 | 293 | json_attr_object_end (&json_ctx); 294 | 295 | json_attr_object_end (&json_ctx); 296 | 297 | json_attr_object_end (&json_ctx); 298 | 299 | json_document_end (&json_ctx); 300 | 301 | return 0; 302 | } 303 | -------------------------------------------------------------------------------- /benchmark-src/bench-timing.h: -------------------------------------------------------------------------------- 1 | /* Define timing macros. 2 | Copyright (C) 2013-2017 Free Software Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with the GNU C Library; if not, see 17 | . */ 18 | 19 | #include "hp-timing.h" 20 | #include 21 | 22 | #if HP_TIMING_AVAIL && !defined USE_CLOCK_GETTIME 23 | # define GL(x) _##x 24 | # define GLRO(x) _##x 25 | typedef hp_timing_t timing_t; 26 | 27 | # define TIMING_TYPE "hp_timing" 28 | 29 | # define TIMING_INIT(res) ({ (res) = 1; }) 30 | 31 | # define TIMING_NOW(var) HP_TIMING_NOW (var) 32 | # define TIMING_DIFF(diff, start, end) HP_TIMING_DIFF ((diff), (start), (end)) 33 | # define TIMING_ACCUM(sum, diff) HP_TIMING_ACCUM_NT ((sum), (diff)) 34 | 35 | #else 36 | 37 | #include 38 | typedef uint64_t timing_t; 39 | 40 | # define TIMING_TYPE "clock_gettime" 41 | 42 | /* Measure the resolution of the clock so we can scale the number of 43 | benchmark iterations by this value. */ 44 | # define TIMING_INIT(res) \ 45 | ({ \ 46 | struct timespec start; \ 47 | clock_getres (CLOCK_PROCESS_CPUTIME_ID, &start); \ 48 | (res) = start.tv_nsec; \ 49 | }) 50 | 51 | # define TIMING_NOW(var) \ 52 | ({ \ 53 | struct timespec tv; \ 54 | clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &tv); \ 55 | (var) = (uint64_t) (tv.tv_nsec + (uint64_t) 1000000000 * tv.tv_sec); \ 56 | }) 57 | 58 | # define TIMING_DIFF(diff, start, end) (diff) = (end) - (start) 59 | # define TIMING_ACCUM(sum, diff) (sum) += (diff) 60 | 61 | #endif 62 | 63 | #define TIMING_PRINT_MEAN(d_total_s, d_iters) \ 64 | printf ("\t%g", (d_total_s) / (d_iters)) 65 | -------------------------------------------------------------------------------- /benchmark-src/hp-timing-common.h: -------------------------------------------------------------------------------- 1 | /* High precision, low overhead timing functions. Generic version. 2 | Copyright (C) 1998-2017 Free Software Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | Contributed by Ulrich Drepper , 1998. 5 | 6 | The GNU C Library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | The GNU C Library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with the GNU C Library; if not, see 18 | . */ 19 | 20 | /* In case a platform supports timers in the hardware the following macros 21 | and types must be defined: 22 | 23 | - HP_TIMING_AVAIL: test for availability. 24 | 25 | - HP_TIMING_INLINE: this macro is non-zero if the functionality is not 26 | implemented using function calls but instead uses some inlined code 27 | which might simply consist of a few assembler instructions. We have to 28 | know this since we might want to use the macros here in places where we 29 | cannot make function calls. 30 | 31 | - hp_timing_t: This is the type for variables used to store the time 32 | values. This type must be integral. 33 | 34 | - HP_TIMING_NOW: place timestamp for current time in variable given as 35 | parameter. 36 | */ 37 | 38 | /* The target supports hp-timing. Share the common infrastructure. */ 39 | 40 | #include 41 | #include 42 | #include "_itoa.h" 43 | 44 | /* Compute the difference between START and END, storing into DIFF. */ 45 | #define HP_TIMING_DIFF(Diff, Start, End) ((Diff) = (End) - (Start)) 46 | 47 | /* Accumulate ADD into SUM. No attempt is made to be thread-safe. */ 48 | #define HP_TIMING_ACCUM_NT(Sum, Diff) ((Sum) += (Diff)) 49 | 50 | /* Write a decimal representation of the timing value into the given string. */ 51 | #define HP_TIMING_PRINT(Dest, Len, Val) \ 52 | do { \ 53 | char __buf[20]; \ 54 | char *__dest = (Dest); \ 55 | size_t __len = (Len); \ 56 | char *__cp = _itoa ((Val), __buf + sizeof (__buf), 10, 0); \ 57 | size_t __cp_len = MIN (__buf + sizeof (__buf) - __cp, __len); \ 58 | memcpy (__dest, __cp, __cp_len); \ 59 | memcpy (__dest + __cp_len, " cycles", \ 60 | MIN (__len - __cp_len, sizeof (" cycles"))); \ 61 | __dest[__len - 1] = '\0'; \ 62 | } while (0) 63 | -------------------------------------------------------------------------------- /benchmark-src/hp-timing.h: -------------------------------------------------------------------------------- 1 | /* High precision, low overhead timing functions. x86-64 version. 2 | Copyright (C) 2002-2017 Free Software Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with the GNU C Library; if not, see 17 | . */ 18 | 19 | #ifndef _HP_TIMING_H 20 | #define _HP_TIMING_H 1 21 | 22 | /* We always assume having the timestamp register. */ 23 | #define HP_TIMING_AVAIL (1) 24 | #define HP_SMALL_TIMING_AVAIL (1) 25 | 26 | /* We indeed have inlined functions. */ 27 | #define HP_TIMING_INLINE (1) 28 | 29 | /* We use 64bit values for the times. */ 30 | typedef unsigned long long int hp_timing_t; 31 | 32 | /* The "=A" constraint used in 32-bit mode does not work in 64-bit mode. */ 33 | #define HP_TIMING_NOW(Var) \ 34 | ({ unsigned int _hi, _lo; \ 35 | asm volatile ("rdtsc" : "=a" (_lo), "=d" (_hi)); \ 36 | (Var) = ((unsigned long long int) _hi << 32) | _lo; }) 37 | 38 | #include "hp-timing-common.h" 39 | 40 | #endif /* hp-timing.h */ 41 | -------------------------------------------------------------------------------- /benchmark-src/json-lib.c: -------------------------------------------------------------------------------- 1 | /* Simple library for printing JSON data. 2 | Copyright (C) 2014-2017 Free Software Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with the GNU C Library; if not, see 17 | . */ 18 | 19 | #include 20 | 21 | #include "json-lib.h" 22 | 23 | void 24 | json_init (json_ctx_t *ctx, unsigned int indent_level, FILE *fp) 25 | { 26 | ctx->indent_level = indent_level; 27 | ctx->fp = fp; 28 | ctx->first_element = true; 29 | } 30 | 31 | static void 32 | do_indent (json_ctx_t *ctx) 33 | { 34 | char indent_buf[ctx->indent_level + 1]; 35 | 36 | memset (indent_buf, ' ', ctx->indent_level + 1); 37 | indent_buf[ctx->indent_level] = '\0'; 38 | 39 | fputs (indent_buf, ctx->fp); 40 | } 41 | 42 | void 43 | json_document_begin (json_ctx_t *ctx) 44 | { 45 | do_indent (ctx); 46 | 47 | fputs ("{\n", ctx->fp); 48 | 49 | ctx->indent_level++; 50 | ctx->first_element = true; 51 | } 52 | 53 | void 54 | json_document_end (json_ctx_t *ctx) 55 | { 56 | ctx->indent_level--; 57 | 58 | do_indent (ctx); 59 | 60 | fputs ("\n}", ctx->fp); 61 | } 62 | 63 | void 64 | json_attr_object_begin (json_ctx_t *ctx, const char *name) 65 | { 66 | if (!ctx->first_element) 67 | fprintf (ctx->fp, ",\n"); 68 | 69 | do_indent (ctx); 70 | 71 | fprintf (ctx->fp, "\"%s\": {\n", name); 72 | 73 | ctx->indent_level++; 74 | ctx->first_element = true; 75 | } 76 | 77 | void 78 | json_attr_object_end (json_ctx_t *ctx) 79 | { 80 | ctx->indent_level--; 81 | ctx->first_element = false; 82 | 83 | fputs ("\n", ctx->fp); 84 | 85 | do_indent (ctx); 86 | 87 | fputs ("}", ctx->fp); 88 | } 89 | 90 | void 91 | json_attr_string (json_ctx_t *ctx, const char *name, const char *s) 92 | { 93 | if (!ctx->first_element) 94 | fprintf (ctx->fp, ",\n"); 95 | else 96 | ctx->first_element = false; 97 | 98 | do_indent (ctx); 99 | 100 | fprintf (ctx->fp, "\"%s\": \"%s\"", name, s); 101 | } 102 | 103 | void 104 | json_attr_uint (json_ctx_t *ctx, const char *name, uint64_t d) 105 | { 106 | if (!ctx->first_element) 107 | fprintf (ctx->fp, ",\n"); 108 | else 109 | ctx->first_element = false; 110 | 111 | do_indent (ctx); 112 | 113 | fprintf (ctx->fp, "\"%s\": %" PRIu64 , name, d); 114 | } 115 | 116 | void 117 | json_attr_int (json_ctx_t *ctx, const char *name, int64_t d) 118 | { 119 | if (!ctx->first_element) 120 | fprintf (ctx->fp, ",\n"); 121 | else 122 | ctx->first_element = false; 123 | 124 | do_indent (ctx); 125 | 126 | fprintf (ctx->fp, "\"%s\": %" PRId64 , name, d); 127 | } 128 | 129 | void 130 | json_attr_double (json_ctx_t *ctx, const char *name, double d) 131 | { 132 | if (!ctx->first_element) 133 | fprintf (ctx->fp, ",\n"); 134 | else 135 | ctx->first_element = false; 136 | 137 | do_indent (ctx); 138 | 139 | fprintf (ctx->fp, "\"%s\": %g", name, d); 140 | } 141 | 142 | void 143 | json_array_begin (json_ctx_t *ctx, const char *name) 144 | { 145 | if (!ctx->first_element) 146 | fprintf (ctx->fp, ",\n"); 147 | 148 | do_indent (ctx); 149 | 150 | fprintf (ctx->fp, "\"%s\": [", name); 151 | 152 | ctx->indent_level++; 153 | ctx->first_element = true; 154 | } 155 | 156 | void 157 | json_array_end (json_ctx_t *ctx) 158 | { 159 | ctx->indent_level--; 160 | ctx->first_element = false; 161 | 162 | fputs ("]", ctx->fp); 163 | } 164 | 165 | void 166 | json_element_string (json_ctx_t *ctx, const char *s) 167 | { 168 | if (!ctx->first_element) 169 | fprintf (ctx->fp, ", \"%s\"", s); 170 | else 171 | { 172 | fprintf (ctx->fp, "\"%s\"", s); 173 | ctx->first_element = false; 174 | } 175 | } 176 | 177 | void 178 | json_element_uint (json_ctx_t *ctx, uint64_t d) 179 | { 180 | if (!ctx->first_element) 181 | fprintf (ctx->fp, ", %" PRIu64, d); 182 | else 183 | { 184 | fprintf (ctx->fp, "%" PRIu64, d); 185 | ctx->first_element = false; 186 | } 187 | } 188 | 189 | void 190 | json_element_int (json_ctx_t *ctx, int64_t d) 191 | { 192 | if (!ctx->first_element) 193 | fprintf (ctx->fp, ", %" PRId64, d); 194 | else 195 | { 196 | fprintf (ctx->fp, "%" PRId64, d); 197 | ctx->first_element = false; 198 | } 199 | } 200 | 201 | void 202 | json_element_double (json_ctx_t *ctx, double d) 203 | { 204 | if (!ctx->first_element) 205 | fprintf (ctx->fp, ", %g", d); 206 | else 207 | { 208 | fprintf (ctx->fp, "%g", d); 209 | ctx->first_element = false; 210 | } 211 | } 212 | 213 | void 214 | json_element_object_begin (json_ctx_t *ctx) 215 | { 216 | if (!ctx->first_element) 217 | fprintf (ctx->fp, ","); 218 | 219 | fputs ("\n", ctx->fp); 220 | 221 | do_indent (ctx); 222 | 223 | fputs ("{\n", ctx->fp); 224 | 225 | ctx->indent_level++; 226 | ctx->first_element = true; 227 | } 228 | 229 | void 230 | json_element_object_end (json_ctx_t *ctx) 231 | { 232 | ctx->indent_level--; 233 | ctx->first_element = false; 234 | 235 | fputs ("\n", ctx->fp); 236 | 237 | do_indent (ctx); 238 | 239 | fputs ("}", ctx->fp); 240 | } 241 | -------------------------------------------------------------------------------- /benchmark-src/json-lib.h: -------------------------------------------------------------------------------- 1 | /* Simple library for printing JSON data. 2 | Copyright (C) 2014-2017 Free Software Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with the GNU C Library; if not, see 17 | . */ 18 | 19 | #ifndef __JSON_LIB_H__ 20 | #define __JSON_LIB_H__ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | struct json_ctx 27 | { 28 | FILE *fp; 29 | unsigned int indent_level; 30 | bool first_element; 31 | }; 32 | 33 | typedef struct json_ctx json_ctx_t; 34 | 35 | void json_init (json_ctx_t *ctx, unsigned int indent_level, FILE *fp); 36 | void json_document_begin (json_ctx_t *ctx); 37 | void json_document_end (json_ctx_t *ctx); 38 | void json_attr_object_begin (json_ctx_t *ctx, const char *name); 39 | void json_attr_object_end (json_ctx_t *ctx); 40 | void json_attr_string (json_ctx_t *ctx, const char *name, const char *s); 41 | void json_attr_int (json_ctx_t *ctx, const char *name, int64_t d); 42 | void json_attr_uint (json_ctx_t *ctx, const char *name, uint64_t d); 43 | void json_attr_double (json_ctx_t *ctx, const char *name, double d); 44 | void json_array_begin (json_ctx_t *ctx, const char *name); 45 | void json_array_end (json_ctx_t *ctx); 46 | void json_element_string (json_ctx_t *ctx, const char *s); 47 | void json_element_int (json_ctx_t *ctx, int64_t d); 48 | void json_element_uint (json_ctx_t *ctx, uint64_t d); 49 | void json_element_double (json_ctx_t *ctx, double d); 50 | void json_element_object_begin (json_ctx_t *ctx); 51 | void json_element_object_end (json_ctx_t *ctx); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-corei5/glibc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.91891e+11, 7 | "iterations": 3.63684e+09, 8 | "time_per_iteration": 52.763, 9 | "max_rss": 1732, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.83777e+11, 23 | "iterations": 6.89608e+09, 24 | "time_per_iteration": 55.6515, 25 | "max_rss": 728, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 7.67562e+11, 39 | "iterations": 1.30986e+10, 40 | "time_per_iteration": 58.5987, 41 | "max_rss": 1120, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.53512e+12, 55 | "iterations": 1.3092e+10, 56 | "time_per_iteration": 117.256, 57 | "max_rss": 3380, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 3.07023e+12, 71 | "iterations": 1.318e+10, 72 | "time_per_iteration": 232.946, 73 | "max_rss": 6720, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | }] 82 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-corei5/hardware-inventory.txt: -------------------------------------------------------------------------------- 1 | H/W path Device Class Description 2 | ============================================================= 3 | /0/0 memory 64KiB BIOS 4 | /0/44 memory 16GiB System Memory 5 | /0/44/0 memory DIMM [empty] 6 | /0/44/1 memory 8GiB DIMM DDR3 Synchronous 1333 MHz (0,8 ns) 7 | /0/44/2 memory DIMM [empty] 8 | /0/44/3 memory 8GiB DIMM DDR3 Synchronous 1333 MHz (0,8 ns) 9 | /0/51 processor Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz 10 | /0/51/52 memory 256KiB L1 cache 11 | /0/51/53 memory 1MiB L2 cache 12 | /0/51/54 memory 6MiB L3 cache 13 | Number of CPU cores: 4 14 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-corei5/jemalloc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.91891e+11, 7 | "iterations": 3.77606e+09, 8 | "time_per_iteration": 50.8177, 9 | "max_rss": 9180, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.8378e+11, 23 | "iterations": 7.42865e+09, 24 | "time_per_iteration": 51.6622, 25 | "max_rss": 14816, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 7.67457e+11, 39 | "iterations": 1.39367e+10, 40 | "time_per_iteration": 55.0672, 41 | "max_rss": 19008, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.53511e+12, 55 | "iterations": 1.42143e+10, 56 | "time_per_iteration": 107.998, 57 | "max_rss": 29980, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 3.0696e+12, 71 | "iterations": 1.41499e+10, 72 | "time_per_iteration": 216.934, 73 | "max_rss": 54652, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | }] 82 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-corei5/results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f18m/malloc-benchmarks/e2fdbcdda2df83eadaeea7a82966c1af1aafc71c/results/2018-02-11-desktop-corei5/results.png -------------------------------------------------------------------------------- /results/2018-02-11-desktop-corei5/system_default-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.91891e+11, 7 | "iterations": 2.27201e+09, 8 | "time_per_iteration": 84.4586, 9 | "max_rss": 1708, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.83764e+11, 23 | "iterations": 2.71007e+09, 24 | "time_per_iteration": 141.607, 25 | "max_rss": 1004, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 7.67562e+11, 39 | "iterations": 5.1228e+09, 40 | "time_per_iteration": 149.833, 41 | "max_rss": 1320, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.53492e+12, 55 | "iterations": 5.15617e+09, 56 | "time_per_iteration": 297.686, 57 | "max_rss": 3808, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 3.06992e+12, 71 | "iterations": 5.16504e+09, 72 | "time_per_iteration": 594.365, 73 | "max_rss": 5960, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | }] 82 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-corei5/tcmalloc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.91891e+11, 7 | "iterations": 6.5705e+09, 8 | "time_per_iteration": 29.2049, 9 | "max_rss": 11172, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.83781e+11, 23 | "iterations": 7.6756e+09, 24 | "time_per_iteration": 50.0002, 25 | "max_rss": 8172, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 7.67561e+11, 39 | "iterations": 1.41612e+10, 40 | "time_per_iteration": 54.2019, 41 | "max_rss": 9212, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.53512e+12, 55 | "iterations": 1.96996e+10, 56 | "time_per_iteration": 77.9267, 57 | "max_rss": 10380, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 3.06988e+12, 71 | "iterations": 2.19504e+10, 72 | "time_per_iteration": 139.855, 73 | "max_rss": 14112, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | }] 82 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-xeon3470/glibc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.76e+11, 7 | "iterations": 2.49813e+09, 8 | "time_per_iteration": 70.4524, 9 | "max_rss": 1608, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.51998e+11, 23 | "iterations": 4.73845e+09, 24 | "time_per_iteration": 74.2856, 25 | "max_rss": 796, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 7.03996e+11, 39 | "iterations": 8.28965e+09, 40 | "time_per_iteration": 84.9248, 41 | "max_rss": 1124, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.40798e+12, 55 | "iterations": 9.4996e+09, 56 | "time_per_iteration": 148.215, 57 | "max_rss": 5432, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.81593e+12, 71 | "iterations": 9.41975e+09, 72 | "time_per_iteration": 298.939, 73 | "max_rss": 8408, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | }] 82 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-xeon3470/hardware-inventory.txt: -------------------------------------------------------------------------------- 1 | H/W path Device Class Description 2 | ==================================================== 3 | /0/0 memory 64KiB BIOS 4 | /0/4 processor Intel(R) Xeon(R) CPU X3470 @ 2.93GHz 5 | /0/4/5 memory 256KiB L1 cache 6 | /0/4/6 memory 1MiB L2 cache 7 | /0/4/7 memory 8MiB L3 cache 8 | /0/2a memory 32GiB System Memory 9 | /0/2a/0 memory 8GiB DIMM DDR3 Synchronous 1333 MHz (0,8 ns) 10 | /0/2a/1 memory 8GiB DIMM DDR3 Synchronous 1333 MHz (0,8 ns) 11 | /0/2a/2 memory 8GiB DIMM DDR3 Synchronous 1333 MHz (0,8 ns) 12 | /0/2a/3 memory 8GiB DIMM DDR3 Synchronous 1333 MHz (0,8 ns) 13 | Number of CPU cores: 8 14 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-xeon3470/jemalloc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.76e+11, 7 | "iterations": 2.30692e+09, 8 | "time_per_iteration": 76.292, 9 | "max_rss": 9488, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.51997e+11, 23 | "iterations": 4.44552e+09, 24 | "time_per_iteration": 79.1801, 25 | "max_rss": 14896, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 7.03992e+11, 39 | "iterations": 7.85178e+09, 40 | "time_per_iteration": 89.6601, 41 | "max_rss": 18952, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.40786e+12, 55 | "iterations": 1.00863e+10, 56 | "time_per_iteration": 139.581, 57 | "max_rss": 33352, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.81584e+12, 71 | "iterations": 1.00018e+10, 72 | "time_per_iteration": 281.535, 73 | "max_rss": 54564, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | }] 82 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-xeon3470/results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f18m/malloc-benchmarks/e2fdbcdda2df83eadaeea7a82966c1af1aafc71c/results/2018-02-11-desktop-xeon3470/results.png -------------------------------------------------------------------------------- /results/2018-02-11-desktop-xeon3470/system_default-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.76e+11, 7 | "iterations": 1.79142e+09, 8 | "time_per_iteration": 98.246, 9 | "max_rss": 1736, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.51995e+11, 23 | "iterations": 2.38045e+09, 24 | "time_per_iteration": 147.869, 25 | "max_rss": 1024, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 7.03991e+11, 39 | "iterations": 4.34954e+09, 40 | "time_per_iteration": 161.854, 41 | "max_rss": 3072, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.40792e+12, 55 | "iterations": 3.69266e+09, 56 | "time_per_iteration": 381.275, 57 | "max_rss": 4040, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.81586e+12, 71 | "iterations": 3.6741e+09, 72 | "time_per_iteration": 766.408, 73 | "max_rss": 5956, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | }] 82 | -------------------------------------------------------------------------------- /results/2018-02-11-desktop-xeon3470/tcmalloc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.76e+11, 7 | "iterations": 4.0956e+09, 8 | "time_per_iteration": 42.9729, 9 | "max_rss": 8648, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.51999e+11, 23 | "iterations": 5.87256e+09, 24 | "time_per_iteration": 59.9396, 25 | "max_rss": 7928, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 7.03944e+11, 39 | "iterations": 1.12432e+10, 40 | "time_per_iteration": 62.6106, 41 | "max_rss": 11600, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.40799e+12, 55 | "iterations": 1.55072e+10, 56 | "time_per_iteration": 90.7958, 57 | "max_rss": 10172, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.81598e+12, 71 | "iterations": 1.57464e+10, 72 | "time_per_iteration": 178.834, 73 | "max_rss": 11712, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | }] 82 | -------------------------------------------------------------------------------- /results/2018-02-11-server-xeon2680/hardware-inventory.txt: -------------------------------------------------------------------------------- 1 | H/W path Device Class Description 2 | =========================================================== 3 | /0/0 memory 64KiB BIOS 4 | /0/4 processor Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz 5 | /0/4/5 memory 640KiB L1 cache 6 | /0/4/6 memory 2560KiB L2 cache 7 | /0/4/7 memory 25MiB L3 cache 8 | /0/6 processor Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz 9 | /0/6/9 memory 640KiB L1 cache 10 | /0/6/a memory 2560KiB L2 cache 11 | /0/6/b memory 25MiB L3 cache 12 | /0/3e memory 192GiB System Memory 13 | /0/3e/0 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 14 | /0/3e/1 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 15 | /0/3e/2 memory DIMM Synchronous [empty] 16 | /0/3e/3 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 17 | /0/3e/4 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 18 | /0/3e/5 memory DIMM Synchronous [empty] 19 | /0/3e/6 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 20 | /0/3e/7 memory DIMM Synchronous [empty] 21 | /0/3e/8 memory DIMM Synchronous [empty] 22 | /0/3e/9 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 23 | /0/3e/a memory DIMM Synchronous [empty] 24 | /0/3e/b memory DIMM Synchronous [empty] 25 | /0/3e/c memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 26 | /0/3e/d memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 27 | /0/3e/e memory DIMM Synchronous [empty] 28 | /0/3e/f memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 29 | /0/3e/10 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 30 | /0/3e/11 memory DIMM Synchronous [empty] 31 | /0/3e/12 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 32 | /0/3e/13 memory DIMM Synchronous [empty] 33 | /0/3e/14 memory DIMM Synchronous [empty] 34 | /0/3e/15 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 35 | /0/3e/16 memory DIMM Synchronous [empty] 36 | /0/3e/17 memory DIMM Synchronous [empty] 37 | Number of CPU cores: 40 38 | -------------------------------------------------------------------------------- /results/2018-02-11-server-xeon2680/jemalloc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.67589e+11, 7 | "iterations": 3.59654e+09, 8 | "time_per_iteration": 46.5973, 9 | "max_rss": 7152, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.35178e+11, 23 | "iterations": 6.97158e+09, 24 | "time_per_iteration": 48.0778, 25 | "max_rss": 15284, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 6.70356e+11, 39 | "iterations": 1.31155e+10, 40 | "time_per_iteration": 51.1116, 41 | "max_rss": 23484, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.34069e+12, 55 | "iterations": 2.49975e+10, 56 | "time_per_iteration": 53.6331, 57 | "max_rss": 40140, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.68126e+12, 71 | "iterations": 4.18638e+10, 72 | "time_per_iteration": 64.0472, 73 | "max_rss": 77036, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | },{ 82 | "timing_type": "hp_timing", 83 | "functions": { 84 | "malloc": { 85 | "": { 86 | "duration": 5.36205e+12, 87 | "iterations": 5.87881e+10, 88 | "time_per_iteration": 91.2097, 89 | "max_rss": 139004, 90 | "threads": 32, 91 | "min_size": 4, 92 | "max_size": 32768, 93 | "random_seed": 88 94 | } 95 | } 96 | } 97 | },{ 98 | "timing_type": "hp_timing", 99 | "functions": { 100 | "malloc": { 101 | "": { 102 | "duration": 6.70193e+12, 103 | "iterations": 5.6236e+10, 104 | "time_per_iteration": 119.175, 105 | "max_rss": 171964, 106 | "threads": 40, 107 | "min_size": 4, 108 | "max_size": 32768, 109 | "random_seed": 88 110 | } 111 | } 112 | } 113 | }] 114 | -------------------------------------------------------------------------------- /results/2018-02-11-server-xeon2680/results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f18m/malloc-benchmarks/e2fdbcdda2df83eadaeea7a82966c1af1aafc71c/results/2018-02-11-server-xeon2680/results.png -------------------------------------------------------------------------------- /results/2018-02-11-server-xeon2680/system_default-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.67589e+11, 7 | "iterations": 1.92291e+09, 8 | "time_per_iteration": 87.1541, 9 | "max_rss": 792, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.35178e+11, 23 | "iterations": 2.68876e+09, 24 | "time_per_iteration": 124.659, 25 | "max_rss": 948, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 6.70354e+11, 39 | "iterations": 4.98579e+09, 40 | "time_per_iteration": 134.453, 41 | "max_rss": 1244, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.34071e+12, 55 | "iterations": 9.50907e+09, 56 | "time_per_iteration": 140.993, 57 | "max_rss": 1972, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.68138e+12, 71 | "iterations": 1.77093e+10, 72 | "time_per_iteration": 151.411, 73 | "max_rss": 7388, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | },{ 82 | "timing_type": "hp_timing", 83 | "functions": { 84 | "malloc": { 85 | "": { 86 | "duration": 5.36266e+12, 87 | "iterations": 2.55631e+10, 88 | "time_per_iteration": 209.781, 89 | "max_rss": 14104, 90 | "threads": 32, 91 | "min_size": 4, 92 | "max_size": 32768, 93 | "random_seed": 88 94 | } 95 | } 96 | } 97 | },{ 98 | "timing_type": "hp_timing", 99 | "functions": { 100 | "malloc": { 101 | "": { 102 | "duration": 6.70324e+12, 103 | "iterations": 2.74124e+10, 104 | "time_per_iteration": 244.533, 105 | "max_rss": 17348, 106 | "threads": 40, 107 | "min_size": 4, 108 | "max_size": 32768, 109 | "random_seed": 88 110 | } 111 | } 112 | } 113 | }] 114 | -------------------------------------------------------------------------------- /results/2018-02-11-server-xeon2680/tcmalloc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.67589e+11, 7 | "iterations": 5.7838e+09, 8 | "time_per_iteration": 28.9756, 9 | "max_rss": 7372, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.35178e+11, 23 | "iterations": 3.11359e+09, 24 | "time_per_iteration": 107.65, 25 | "max_rss": 7404, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 6.70355e+11, 39 | "iterations": 3.85864e+09, 40 | "time_per_iteration": 173.728, 41 | "max_rss": 7860, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.34071e+12, 55 | "iterations": 8.13868e+09, 56 | "time_per_iteration": 164.733, 57 | "max_rss": 8596, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.6814e+12, 71 | "iterations": 2.10405e+10, 72 | "time_per_iteration": 127.44, 73 | "max_rss": 9148, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | },{ 82 | "timing_type": "hp_timing", 83 | "functions": { 84 | "malloc": { 85 | "": { 86 | "duration": 5.36279e+12, 87 | "iterations": 4.97178e+10, 88 | "time_per_iteration": 107.864, 89 | "max_rss": 13452, 90 | "threads": 32, 91 | "min_size": 4, 92 | "max_size": 32768, 93 | "random_seed": 88 94 | } 95 | } 96 | } 97 | },{ 98 | "timing_type": "hp_timing", 99 | "functions": { 100 | "malloc": { 101 | "": { 102 | "duration": 6.70339e+12, 103 | "iterations": 6.02992e+10, 104 | "time_per_iteration": 111.169, 105 | "max_rss": 18728, 106 | "threads": 40, 107 | "min_size": 4, 108 | "max_size": 32768, 109 | "random_seed": 88 110 | } 111 | } 112 | } 113 | }] 114 | -------------------------------------------------------------------------------- /results/2018-03-17-server-xeon2680/hardware-inventory.txt: -------------------------------------------------------------------------------- 1 | H/W path Device Class Description 2 | =========================================================== 3 | /0/0 memory 64KiB BIOS 4 | /0/4 processor Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz 5 | /0/4/5 memory 640KiB L1 cache 6 | /0/4/6 memory 2560KiB L2 cache 7 | /0/4/7 memory 25MiB L3 cache 8 | /0/6 processor Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz 9 | /0/6/9 memory 640KiB L1 cache 10 | /0/6/a memory 2560KiB L2 cache 11 | /0/6/b memory 25MiB L3 cache 12 | /0/3e memory 192GiB System Memory 13 | /0/3e/0 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 14 | /0/3e/1 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 15 | /0/3e/2 memory DIMM Synchronous [empty] 16 | /0/3e/3 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 17 | /0/3e/4 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 18 | /0/3e/5 memory DIMM Synchronous [empty] 19 | /0/3e/6 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 20 | /0/3e/7 memory DIMM Synchronous [empty] 21 | /0/3e/8 memory DIMM Synchronous [empty] 22 | /0/3e/9 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 23 | /0/3e/a memory DIMM Synchronous [empty] 24 | /0/3e/b memory DIMM Synchronous [empty] 25 | /0/3e/c memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 26 | /0/3e/d memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 27 | /0/3e/e memory DIMM Synchronous [empty] 28 | /0/3e/f memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 29 | /0/3e/10 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 30 | /0/3e/11 memory DIMM Synchronous [empty] 31 | /0/3e/12 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 32 | /0/3e/13 memory DIMM Synchronous [empty] 33 | /0/3e/14 memory DIMM Synchronous [empty] 34 | /0/3e/15 memory 16GiB DIMM DDR3 Synchronous 1600 MHz (0,6 ns) 35 | /0/3e/16 memory DIMM Synchronous [empty] 36 | /0/3e/17 memory DIMM Synchronous [empty] 37 | Number of CPU cores: 40 38 | NUMA informations: 39 | available: 2 nodes (0-1) 40 | node 0 cpus: 0 1 2 3 4 5 6 7 8 9 20 21 22 23 24 25 26 27 28 29 41 | node 0 size: 98225 MB 42 | node 0 free: 37112 MB 43 | node 1 cpus: 10 11 12 13 14 15 16 17 18 19 30 31 32 33 34 35 36 37 38 39 44 | node 1 size: 98304 MB 45 | node 1 free: 51857 MB 46 | node distances: 47 | node 0 1 48 | 0: 10 21 49 | 1: 21 10 50 | -------------------------------------------------------------------------------- /results/2018-03-17-server-xeon2680/jemalloc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.67589e+11, 7 | "iterations": 3.57195e+09, 8 | "time_per_iteration": 46.918, 9 | "max_rss": 7160, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.35178e+11, 23 | "iterations": 6.32096e+09, 24 | "time_per_iteration": 53.0265, 25 | "max_rss": 15292, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 6.70355e+11, 39 | "iterations": 1.13669e+10, 40 | "time_per_iteration": 58.9743, 41 | "max_rss": 23492, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.34068e+12, 55 | "iterations": 2.52372e+10, 56 | "time_per_iteration": 53.1234, 57 | "max_rss": 40148, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.68125e+12, 71 | "iterations": 4.73226e+10, 72 | "time_per_iteration": 56.659, 73 | "max_rss": 73092, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | },{ 82 | "timing_type": "hp_timing", 83 | "functions": { 84 | "malloc": { 85 | "": { 86 | "duration": 5.3619e+12, 87 | "iterations": 5.89451e+10, 88 | "time_per_iteration": 90.9643, 89 | "max_rss": 140860, 90 | "threads": 32, 91 | "min_size": 4, 92 | "max_size": 32768, 93 | "random_seed": 88 94 | } 95 | } 96 | } 97 | },{ 98 | "timing_type": "hp_timing", 99 | "functions": { 100 | "malloc": { 101 | "": { 102 | "duration": 6.70208e+12, 103 | "iterations": 5.933e+10, 104 | "time_per_iteration": 112.963, 105 | "max_rss": 173872, 106 | "threads": 40, 107 | "min_size": 4, 108 | "max_size": 32768, 109 | "random_seed": 88 110 | } 111 | } 112 | } 113 | }] 114 | -------------------------------------------------------------------------------- /results/2018-03-17-server-xeon2680/results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f18m/malloc-benchmarks/e2fdbcdda2df83eadaeea7a82966c1af1aafc71c/results/2018-03-17-server-xeon2680/results.png -------------------------------------------------------------------------------- /results/2018-03-17-server-xeon2680/system_default-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.67589e+11, 7 | "iterations": 1.96885e+09, 8 | "time_per_iteration": 85.1202, 9 | "max_rss": 788, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.35178e+11, 23 | "iterations": 2.58931e+09, 24 | "time_per_iteration": 129.447, 25 | "max_rss": 948, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 6.70355e+11, 39 | "iterations": 4.74517e+09, 40 | "time_per_iteration": 141.271, 41 | "max_rss": 3296, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.3407e+12, 55 | "iterations": 9.57558e+09, 56 | "time_per_iteration": 140.013, 57 | "max_rss": 3884, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.68138e+12, 71 | "iterations": 1.8601e+10, 72 | "time_per_iteration": 144.152, 73 | "max_rss": 7392, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | },{ 82 | "timing_type": "hp_timing", 83 | "functions": { 84 | "malloc": { 85 | "": { 86 | "duration": 5.36268e+12, 87 | "iterations": 2.51548e+10, 88 | "time_per_iteration": 213.187, 89 | "max_rss": 13864, 90 | "threads": 32, 91 | "min_size": 4, 92 | "max_size": 32768, 93 | "random_seed": 88 94 | } 95 | } 96 | } 97 | },{ 98 | "timing_type": "hp_timing", 99 | "functions": { 100 | "malloc": { 101 | "": { 102 | "duration": 6.70328e+12, 103 | "iterations": 2.74263e+10, 104 | "time_per_iteration": 244.411, 105 | "max_rss": 17352, 106 | "threads": 40, 107 | "min_size": 4, 108 | "max_size": 32768, 109 | "random_seed": 88 110 | } 111 | } 112 | } 113 | }] 114 | -------------------------------------------------------------------------------- /results/2018-03-17-server-xeon2680/tcmalloc-results.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "timing_type": "hp_timing", 3 | "functions": { 4 | "malloc": { 5 | "": { 6 | "duration": 1.67589e+11, 7 | "iterations": 5.76821e+09, 8 | "time_per_iteration": 29.0539, 9 | "max_rss": 9472, 10 | "threads": 1, 11 | "min_size": 4, 12 | "max_size": 32768, 13 | "random_seed": 88 14 | } 15 | } 16 | } 17 | },{ 18 | "timing_type": "hp_timing", 19 | "functions": { 20 | "malloc": { 21 | "": { 22 | "duration": 3.35178e+11, 23 | "iterations": 2.05454e+09, 24 | "time_per_iteration": 163.14, 25 | "max_rss": 8476, 26 | "threads": 2, 27 | "min_size": 4, 28 | "max_size": 32768, 29 | "random_seed": 88 30 | } 31 | } 32 | } 33 | },{ 34 | "timing_type": "hp_timing", 35 | "functions": { 36 | "malloc": { 37 | "": { 38 | "duration": 6.70356e+11, 39 | "iterations": 4.25395e+09, 40 | "time_per_iteration": 157.584, 41 | "max_rss": 7828, 42 | "threads": 4, 43 | "min_size": 4, 44 | "max_size": 32768, 45 | "random_seed": 88 46 | } 47 | } 48 | } 49 | },{ 50 | "timing_type": "hp_timing", 51 | "functions": { 52 | "malloc": { 53 | "": { 54 | "duration": 1.34071e+12, 55 | "iterations": 8.139e+09, 56 | "time_per_iteration": 164.727, 57 | "max_rss": 11276, 58 | "threads": 8, 59 | "min_size": 4, 60 | "max_size": 32768, 61 | "random_seed": 88 62 | } 63 | } 64 | } 65 | },{ 66 | "timing_type": "hp_timing", 67 | "functions": { 68 | "malloc": { 69 | "": { 70 | "duration": 2.68141e+12, 71 | "iterations": 2.25797e+10, 72 | "time_per_iteration": 118.754, 73 | "max_rss": 10332, 74 | "threads": 16, 75 | "min_size": 4, 76 | "max_size": 32768, 77 | "random_seed": 88 78 | } 79 | } 80 | } 81 | },{ 82 | "timing_type": "hp_timing", 83 | "functions": { 84 | "malloc": { 85 | "": { 86 | "duration": 5.3628e+12, 87 | "iterations": 5.09283e+10, 88 | "time_per_iteration": 105.301, 89 | "max_rss": 13320, 90 | "threads": 32, 91 | "min_size": 4, 92 | "max_size": 32768, 93 | "random_seed": 88 94 | } 95 | } 96 | } 97 | },{ 98 | "timing_type": "hp_timing", 99 | "functions": { 100 | "malloc": { 101 | "": { 102 | "duration": 6.70346e+12, 103 | "iterations": 6.15451e+10, 104 | "time_per_iteration": 108.92, 105 | "max_rss": 17060, 106 | "threads": 40, 107 | "min_size": 4, 108 | "max_size": 32768, 109 | "random_seed": 88 110 | } 111 | } 112 | } 113 | }] 114 | --------------------------------------------------------------------------------