tinypile
tinypile copied to clipboard
Suggestions :D
It would be cool to have copies of both jps.h & minihttp.h (as single-header lib) in this repo as well :D Looking forward to your next, upcoming libs :D
Hmm but both have the "problem" that they depend so much on STL. If i'm going to redo JPS then only shipping with its own (hash)map impl. minihttp uses std::string, std::map and whatnot (because i was lazy) and is generally awful, so unless that gets its rewrite (unlikely for now) i'd rather have it stay in its own repo.
Thanks for the heads up btw!
Well, you can use still std interface even if the implementation is way different A couple of lines could just open that posibility
// .h
#ifndef JPS_USE_CUSTOM_NAMESPACE
#define JPS_USE_CUSTOM_NAMESPACE std
#endif
namespace jps = JPS_USE_CUSTOM_NAMESPACE;
// .cpp
// then.. just jps::string, jps::map<int,int> etc :D
#endif
Isn't that C++11? I plan to stick to C++03 because oldskool reasons. But re: JPS, I've started refactoring the thing to work without STL and much nicer memory handling. It's quite interesting how one's way of thinking changes once you actually think about the problem instead of just slapping things into some STL container and moving on... Not quite there yet but maybe next week, whenever I have spare time and brain (which is, these days, apparently almost mutually exclusive D:). The new one will go into this repo; the old one will stay in the old repo.
Namespace aliasing is old C++ afaik (see: https://en.cppreference.com/w/cpp/language/namespace_alias) But then, a code refactor would be better for sure. I was just thinking about a cheap workaround :D Cool to know JPS is going to be refreshed :D
Oopsie. Now this was a nice round of optimization. All on a Core i7, for reference. (v1 = old version of JPS.h, v2 = jps.hh, this repo)
Started with MSVC 2008, 32bit exe: v1: 32+ seconds for the testsuite v2 (some days ago, new data structures): ~25s
Changed compiler to MSVC 2015 Same code v2, 32bit exe: ~16s (... huh?!...)
v2 from today, no floats, some cleanups, 64bit exe: 14.2s in comparison, v1, 64bit exe: 39s!
So that's a speed increase of ~2.7x. (And I'd thought the old version was already fast... lol) There are 1-2 more optimizations I want to try, curious what that'll do.
So thanks for the poke to refactor this code. Totally worth it. If you have any use-case story by chance then please let me know. Or close issue when there is nothing else. (Won't touch minihttp anytime soon but I have an idea about B-splines...)