Commit Graph

16 Commits

Author SHA1 Message Date
Dylan Yudaken
15a8c2cc84 Track fetches/memos accurately in profiling (#120)
Summary:
Pull Request resolved: https://github.com/facebook/Haxl/pull/120

This adds tracking of memo/fetches per label by a unique id for each. Using this we can track exactly where time was spent, and where it was shared

Reviewed By: simonmar

Differential Revision: D20792435

fbshipit-source-id: 55c1e778d313d103a910c6dd5be512f95125acce
2020-04-24 08:02:53 -07:00
Dylan Yudaken
fdfb86379b profile more accurately (#119)
Summary:
Pull Request resolved: https://github.com/facebook/Haxl/pull/119

Currently profiling with labels does not track full stacks.
This is problematic in the case where all top level methods end up calling a common method with a label, as we have no way of attributing to the top level methods.
Eg if A/B/C all call X when running work then we cannot tell which work is expensive, as we have no connection from the work through X

Reviewed By: simonmar

Differential Revision: D20384255

fbshipit-source-id: f9aa0462904c17dee32d37a659b491e8d252d6db
2020-04-24 08:02:53 -07:00
Dylan Yudaken
14ebbe2c85 Add tracking of Fetch Stats for the same batch (#111)
Summary:
Pull Request resolved: https://github.com/facebook/Haxl/pull/111

Right now BackgroundFetches produce multiple FetchStats for the same batch, but it is not possible to link these together to get an idea of how big the batch was.
This introduces a field to FetchStats that can be used to link batches together as well as a utility method to do this in a default manner

Reviewed By: watashi

Differential Revision: D19469048

fbshipit-source-id: fce687c49ac4cbdc7cbd6804f37b6f120d7efad3
2020-01-22 04:25:34 -08:00
Dylan Yudaken
c49ba39bd9 Remove FutureFetch from Haxl (#109)
Summary:
Pull Request resolved: https://github.com/facebook/Haxl/pull/109

FutureFetch is unused (except for one test) and overall has not proven itself to be a useful fetch type. It adds a new waiting point (the others being BackgroundFetch and Async/Sync fetches) which can add latency. For example if all three are dispatched in one round how would the scheduler know ahead of time which one to wait on in order to make forward progress.

Reviewed By: simonmar

Differential Revision: D19410093

fbshipit-source-id: 40c900fbff9e06098acb2a21fc59b49adefadc5b
2020-01-16 08:40:22 -08:00
Karen Ang
7a2aa30f90 Switch to use BasicHashTable for Haxl DataCache
Summary: Switch to use `BasicHashTable` from `hashtables` package instead of `Data.HashMap.Strict` for `DataCache`

Reviewed By: simonmar

Differential Revision: D19219048

fbshipit-source-id: a2a8df0e715c202ca79a1f3a1c0dad133788e1eb
2020-01-10 14:37:38 -08:00
Anubhav Bindlish
702cbffbe5 Fix documentation
Summary:
Had updated the implementation of Haxl writes to account for memoization, but forgot to update the doc.

Created from Diffusion's 'Open in Editor' feature.

(Note: this ignores all push blocking failures!)

Reviewed By: xich

Differential Revision: D17498719

fbshipit-source-id: 8f5129271b171849b3bd2aaf0d5e0bce127be1bf
2019-09-20 09:57:15 -07:00
Karen Ang
67638ce8bd Move CallGraphRef to Haxl Env
Summary:
Adds the ability for one to record the function callstack within the `Haxl` monad.
The main function is `withCallGraph`, and supporting types are in `Haxl.Core.CallGraph`.

Reviewed By: watashi

Differential Revision: D14857851

fbshipit-source-id: daab97e8144ff63104ad9e79a3a792a4471e5588
2019-05-14 14:22:50 -07:00
Anubhav Bindlish
c365886e79 Log outgone fetches to Env
Reviewed By: simonmar

Differential Revision: D14467207

fbshipit-source-id: 4c3f551034c2f253a0c8bfff47e0dbc170131255
2019-05-09 06:46:56 -07:00
Anubhav Bindlish
70f5bad436 Add writes to IORef in Env
Summary:
Here I try to populate the writes done as part of a Haxl computation
in an IORef inside the Environment.

`IVar` which is the synchornisation point,
also acts as the point where we store intermediate writes for Haxl
computations, so they can be memoized and reused whenever a memoized
computation is done again. This is done inside `getIVarWithWrites` function.

This works, because we create new IVars when running a memo computation
or a data fetch, and it is only at these places where we need to create a new
environment with empty writes to run the computation in. So I run every memoized
computation in a new environment (with empty writes) and populate the writes in this new
environment. At the end of the memoized computation, I look up these writes from the `IVar`
and also add them to the original environment. This way ultimately all writes are correctly
propagated upwards to the top level environment user passes to `runHaxl`.
This logic lives inside `execMemoNow`.

Reviewed By: simonmar

Differential Revision: D14342181

fbshipit-source-id: a410dae1a477f27b480804b67b2212e7500997ab
2019-04-10 09:48:57 -07:00
Simon Marlow
e187bc2474 Updates for GHC 8.4.x and 8.6.x (#97)
Summary: And bump version to 2.0.1.1

Reviewed By: anubhav94N

Differential Revision: D10011092

fbshipit-source-id: 4d45f79fb4c89112d29d40f0d53a50441a443729
2018-09-24 14:20:57 -07:00
Simon Marlow
9e6d3c3523 Bump to 2.0.1.0
Summary: The MemoVar export causes a minor version bump

Reviewed By: anubhav94N

Differential Revision: D8588703

fbshipit-source-id: 8dfb5ed5f44a681810860080b8413fc61bf58c89
2018-06-25 04:05:40 -07:00
Simon Marlow
c1c789a71f Change license to plain BSD3
Reviewed By: mic47, niteria

Differential Revision: D6519157

fbshipit-source-id: 7fd977837bb7dd8463d697d685107aaf07c95255
2017-12-08 04:33:35 -08:00
Simon Marlow
eecd856bf9 Add changelog for 2.0.0.0
Reviewed By: codemiller

Differential Revision: D6259667

fbshipit-source-id: 2839430f56668f4c9904fdf041f619be8472953f
2017-11-08 08:04:09 -08:00
Bartosz Nitka
f1df1cb368 Prepare for 0.5.1.0 release
Summary:
We need a release for GHC 8.2.1 compatibility:
https://github.com/facebook/Haxl/issues/70

(Note: this ignores all push blocking failures!)

Reviewed By: simonmar

Differential Revision: D5488485

fbshipit-source-id: 61ae115e7456beb1dd8855d387690e13a1e09bdc
2017-07-25 04:24:40 -07:00
Oleg Grenrus
b0a5f7b8a8 Rename Show1 to ShowP
Summary:
Resolve #62
Closes https://github.com/facebook/Haxl/pull/63

Reviewed By: JonCoens

Differential Revision: D4299180

Pulled By: niteria

fbshipit-source-id: 0bcbefd26184d1e7ad5de99a806ce0cf4b57d1a6
2016-12-09 14:31:39 -08:00
Simon Marlow
037de9c594 Overhaul docs; bump to 0.3.0.0; add changelog
Summary: Tidy everything up in preparation for a Hackage reelase

Test Plan: cabal test; unit tests

Reviewed By: kjm@fb.com

Subscribers: anfarmer, kjm, jlengyel, watashi, smarlow, akr, bnitka, jcoens

FB internal diff: D2516904

Signature: t1:2516904:1444297290:52077660599ab126ec8a3e4530808db7c15d1876
2015-10-12 06:23:49 -07:00