Use C's const char* for status strings rather than C++'s std::string, which is slower
Optimize HTTP status messages #566
pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:optimize_http_status changing 1 files +8 −7-
luke-jr commented at 8:56 PM on October 4, 2011: member
-
gavinandresen commented at 2:16 PM on October 5, 2011: contributor
How much slower, for what, on what type of system?
-
luke-jr commented at 3:01 PM on October 5, 2011: member
C++ would need to: allocate memory for std::string data, scan length of const data, copy const data, return a pointer to its own data, and make at least 3 function calls to do so. The C equivalent just passes the pointer to the const data directly. I imagine under high load, this could make a difference, but I haven't done any benchmarking. Apparently it was deemed important enough for JoelKatz to take his time to do it.
-
TheBlueMatt commented at 3:05 PM on October 5, 2011: member
This is just cleaner code anyway, no reason not to merge.
-
gavinandresen commented at 6:37 PM on October 5, 2011: contributor
needs rebasing
-
Use C's const char* for status strings rather than C++'s std::string, which is slower ae81b82fb8
-
luke-jr commented at 6:50 PM on October 5, 2011: member
Rebased.
- gavinandresen referenced this in commit e653578db3 on Oct 5, 2011
- gavinandresen merged this on Oct 5, 2011
- gavinandresen closed this on Oct 5, 2011
- coblee referenced this in commit 1017f0ad14 on Jul 17, 2012
- ptschip referenced this in commit 62c4951c43 on Jul 21, 2017
- fjahr referenced this in commit a484e0008b on Jul 24, 2019
- elichai referenced this in commit 461acf5c6c on Aug 22, 2019
- sipa referenced this in commit 6b9cd1520b on Sep 24, 2019
- kallewoof referenced this in commit d669b31c9a on Oct 4, 2019
- kallewoof referenced this in commit c866f52e2a on Oct 4, 2019
- sipa referenced this in commit 544c1f35e7 on Nov 6, 2019
- sipa referenced this in commit d5cd9db7a3 on Nov 19, 2019
- sipa referenced this in commit de659898b6 on Jan 21, 2020
- sipa referenced this in commit 36362dfb90 on Jan 23, 2020
- jnewbery referenced this in commit 85e7d06351 on Mar 17, 2020
- sipa referenced this in commit 4977ac14d3 on Mar 18, 2020
- sipa referenced this in commit 5bf7fb5baa on Mar 18, 2020
- sipa referenced this in commit fb2a05e468 on Mar 19, 2020
- sipa referenced this in commit 497fad6f09 on Mar 21, 2020
- sipa referenced this in commit eae016f117 on Mar 22, 2020
- sipa referenced this in commit 4e37a7c2cb on Mar 27, 2020
- jnewbery referenced this in commit 9696dea839 on Apr 16, 2020
- jnewbery referenced this in commit a541fd0e87 on Apr 19, 2020
- sipa referenced this in commit c308759ea5 on Apr 19, 2020
- sipa referenced this in commit 4eaec32f1c on May 2, 2020
- sipa referenced this in commit ef7117193c on May 22, 2020
- sipa referenced this in commit 67f232b5d8 on Jun 9, 2020
- stackman27 referenced this in commit 78cde6f8c7 on Jun 26, 2020
- rajarshimaitra referenced this in commit 7f9206a0aa on Aug 5, 2021
- DrahtBot locked this on Sep 8, 2021
Contributors