Commit graph

934 commits

Author SHA1 Message Date
7dd2646dbb add basic caching - TODO: avoid these computations in the controller 2014-01-10 16:25:02 -05:00
9a4e114964 oh yum, this is really starting to come together :) 2014-01-10 16:25:02 -05:00
85e1973f55 yummy mockups for newest items progress bars 2014-01-10 16:25:02 -05:00
7c6e607612 basic neopia api integration 2014-01-10 16:25:02 -05:00
fef87d664a ugh, why are basic hashes in a yaml file instead of the database? :( 2014-01-10 16:23:54 -05:00
4a49ad2fe8 oh poo, didn't commit these properly with the closet hanger caching :( 2013-12-27 21:48:38 -05:00
b6247fa22f prepare partials for closet_hangers#index, too 2013-12-27 21:48:28 -05:00
1ce32e5867 Use item proxies better for items#index?format=html :D
We used get_multi when preparing the proxies to decide which to
load from the database, but then sent multiple get requests to
Memcache to re-fetch the same data from that get_multi. Silly!
Use the data that's already stored on the proxy anyway.
2013-12-27 21:11:03 -05:00
6b340f906e Cache trade info on items#show, finally! I think it's the performance culprit. 2013-12-27 14:49:46 -05:00
5f95ef7e56 make userbar area more compact, including removing favicon 2013-12-26 13:08:51 -05:00
10b3f49249 finally fix bottom border on default preview (beach) 2013-12-26 12:56:15 -05:00
12a1c0f500 monocle favicon 2013-12-26 12:44:03 -05:00
cdffcfbcfd TIL item proxies can read from the cache in bulk 2013-12-09 01:15:57 -06:00
728ff60c5f move item cache sweeping and flex syncing to background tasks 2013-12-09 00:12:05 -06:00
4144b4dc74 only send cache deletions for usable locales
Right now we're spending too much time expiring cache keys when
getting contributions. The longer-term fix is to move it to a
background task, but it's good to restrict deletions only to usable
locales rather than all the ones that Rails theoretically supports.
2013-12-08 23:44:25 -06:00
f07996d762 cache pet images on items#show, in case that's what's being a super-slow jerkface 2013-12-05 15:22:43 -06:00
cc7ac363dd WIP commit for speeding up item show pages 2013-12-05 13:27:56 -06:00
0cdbe99c88 use yesterday's notables for spotlights, because I never update spotlight pets :P 2013-12-05 13:08:46 -06:00
5ba01b5672 update to rails 3.2.16 for security 2013-12-03 14:48:03 -06:00
3bf5680476 track passenger pids for easier monitoring (why do they take so much memory?!) 2013-11-30 20:47:02 -05:00
2b870cf91b add pet state replacement task 2013-11-30 20:33:48 -05:00
8bd7ad5a1e support manually uploaded swf asset images - not the actual uploading, but block them from being reconverted 2013-10-16 15:50:48 -05:00
0cb7fc87df include zones_restrict in item selector when mall spidering, to avoid flex_source errors 2013-10-08 14:42:46 -05:00
2f607036f2 Bug fix: wardrobe's AJAX load order won't affect closet behavior
Fun bug! If you edit an outfit, but the outfit loads before the
closet items do, then we clone the outfit to give it its new
identity and therefore forget about its item load callbacks.
Now we have a cheap hack to forward item load data to the
outfit's clones. Hooray! Hope this doesn't break tons of things!
2013-08-23 15:58:49 -04:00
019303031b choose list when importing from pets 2013-08-17 12:07:04 -04:00
1dd3acbe92 oops, items that restrict the same zones don't conflict 2013-08-13 00:45:55 -04:00
00b0394d01 include zone restrictions in item conflict checks
That is, Neopets.com will raise an error when you try to equip a
Kyrii Mage Cape to a pet who's already wearing Ceremonial Shenkuu
Warrior Armour, since the armor restricts the Collar zone which
the cape occupies. DTI, however, would just hide the Collar zone,
as if it were biology. Now, however, DTI will unwear the armor
when you wear the cape, and vice-versa (despite the restriction
relationship being one-directional).
2013-08-12 20:30:38 -04:00
e48d00294d fix silly closet hanger merge bug involving flex 2013-07-28 23:30:29 -07:00
082119afe1 fix some mall spider bugs, including not having all the attributes it needed for search indexing 2013-07-09 21:00:36 -07:00
d767953ef3 use addressable 2.3.5 for ruby 2.0 compatibility 2013-07-09 20:06:43 -07:00
9bd49aa85d first step in repairing mall spider 2013-07-09 20:01:55 -07:00
72c59f0b68 if there's only one item search result, redirect to it 2013-07-09 19:54:22 -07:00
4c208c9ac3 instead of returning an empty item list on contradiction, return an empty proxy collection 2013-07-03 18:17:16 -07:00
daf1f140fb pet rate limit is now 3/30sec 2013-07-02 20:50:34 -07:00
4acc0e22c8 bulk pet loader rate limits itself 2013-07-02 14:10:24 -07:00
abe35c6fd9 throttle pet loads per ip 2013-07-02 14:10:01 -07:00
5e60795f31 Oops, delegate Item::Proxy#to_param to the item, or we get bad links. 2013-06-27 10:47:02 -07:00
b92131b26c use item proxies in items#index when given item IDs 2013-06-27 00:15:20 -07:00
5b9394ce82 oops - don't cache as_json's owned/wanted, but instead have the proxy override 2013-06-27 00:10:55 -07:00
bf697cef7b expire item#as_json when updated 2013-06-27 00:00:37 -07:00
9e3cac82ec use proxies for item html, too
Some lame benchmarking on my box, dev, cache classes, many items:

No proxies:
    Fresh JSON:  175,  90,  90,  93,  82, 88, 158, 150, 85, 167 = 117.8
    Cached JSON: (none)
    Fresh HTML:  371, 327, 355, 328, 322, 346 = 341.5
    Cached HTML: 173, 123, 175, 187, 171, 179 = 168

Proxies:
    Fresh JSON:  175, 183, 269, 219, 195, 178 = 203.17
    Cached JSON:  88,  70,  89, 162,  80,  77 = 94.3
    Fresh HTML:  494, 381, 350, 334, 451, 372 = 397
    Cached HTML: 176, 170, 104, 101, 111, 116 = 129.7

So, overhead is significant, but the gains when cached (and that should be
all the time, since we currently have 0 evictions) are definitely worth
it. Worth pushing, and probably putting some future effort into reducing
overhead.

On production (again, lame), items#index was consistently averaging
73-74ms when super healthy, and 82ms when pets#index was being louder
than usual. For reference is all. This will probably perform
significantly worse at first (in JSON, anyway, since HTML is already
mostly cached), so it might be worth briefly warming the cache after
pushing.
2013-06-26 23:50:19 -07:00
e42de795dd Use item proxies for JSON caching
That is, once we get our list of IDs from the search engine, only
fetch records whose JSON we don't already have cached.

It's simpler here to use as_json, but it'd probably be even faster
if I figure out how to serve a plain JSON string from a Rails
controller. In the meantime, requests of entirely cached items
are coming in at about 85ms on average on my box (dev, cache
classes, many items), about 10ms better than the last
iteration.
2013-06-26 23:01:12 -07:00
298eb46871 speed up scoped_loaded_collection in item search a bit
Reduces items#index.json by about 10ms per request on my box, development with
cache_classes=true. The time isn't huge, but is worthwhile.
2013-06-26 21:39:54 -07:00
6984201990 dev util method to manually change SWF asset body ID 2013-06-26 20:08:19 -07:00
b93dbb8e49 Remove redundant queries when importing closet pages
Specifically, we were running a find_or_initialize_by for all 50
hangers, which isn't great. Collation logic is more complicated this
way, but query count is way lower.

Additionally, compare against hanger.list_id instead of hanger.list,
because hanger.list will fire a query if list_id is non-nil, but that
nil ID tells us everything we needed to know, anyway.
2013-06-26 00:10:52 -07:00
a7574f0864 Don't add duplicate hangers now that closet import can specify a list
Bug report that this resolves:

...However, when I was using the "Import from SDB" tool just a few
minutes ago, it ended up adding EVERY neocash item into the "Not
In A List" section, regardless if I already that item imported
into my "Your Items". So, basically.. I had duplicates of
everything and it would not allow me to move them around into
separate catergories or anything. I know that every other time i've
used the import tool, it would only add NEW items that are not
currently already in my lists yet.
2013-06-25 23:40:02 -07:00
fb219f82e8 sigh, add another special color description format 2013-06-23 22:58:17 -07:00
3c127569fe stop caching item preview species images, and fix the bad query instead
Most of the reasoning is documented in the big comment. In short, we tried
to solve the problem with caching, but the caching should hardly be necessary
now that the bottleneck should be fixed. We'll see on production if it
actually solves the whole problem, but I've confirmed in the console that
redefining this function makes random_basic_per_species (as called during
rendering) a ton faster. And this way we keep our randomness, woo!
2013-06-23 22:35:27 -07:00
d858f33083 noscript warning on closet_hangers#index 2013-06-22 16:42:38 -07:00
816584f177 Move item_link partial caching to a helper rather than the template itself
This is a surprisingly huge performance gain. On my testing (with
cache_classes set to true to also cache templates), this sped up
closet_hangers#index rendering by a factor of 2 when there were a
significant number of items. Cool beans.

I think we can even hold off on the individual hanger caching now:
we've made the closet hanger partial tons faster by moving forms out
of them and doing this cache check earlier. I'm expecting significant
performance gains both here and on items#index (though less so there).
I'll deploy and see how much it helps in production; if not enough, we
can look at the layered caching of hangers, lists, groups, full pages,
etc.

So glad we don't *have* to move to a pagination model!
2013-06-22 16:31:46 -07:00