| <<<Back 1 day (to 2016/04/14) | 20160415 |
HenryStiles | Robin_Watts, kens, chrisl, jogux :any recommendations train vs. car rental for the lake district? Looks like there is pretty good transportation in the Lakes District but it might be better to have a car. Flying into London 5/27 and coming back to London 6/1. | 13:32.05 |
Robin_Watts | HenryStiles: Get a car. | 13:32.55 |
| Driving to/from the lakes will take a while (5+hrs at UK speeds, longer at US speeds) | 13:34.10 |
jogux | Unless you're uncomfortable driving on the left on narrow windy roads, definitely get a car. | 13:34.52 |
Robin_Watts | But getting around in the lakes without a car will involve a LOT of waiting for overcrowded, late, rare buses that don't quite go where you want. | 13:35.14 |
jogux | I've never found public transport around the lake district useful, unless you happen to very carefully pick where you want to go. | 13:35.29 |
Robin_Watts | You *could* maybe hire bikes, but I suspect that would be more popular with HenryStiles than with Sabrina. | 13:35.37 |
HenryStiles | sounds like fun, but sabrina is terrified | 13:35.40 |
Robin_Watts | You're going to have to drive the last bit, pretty much, and the bits prior to that are motorways (freeways in USian). | 13:36.26 |
jogux | Robin_Watts: Even with bikes it would need some careful route plotting, in most cases you wouldn't want to cycle on the roads imho. | 13:36.27 |
Robin_Watts | Motorway driving is the easiest form of driving while abroad cos there is relatively little chance of driving on the wrong side. | 13:37.16 |
| Can you drive a stick? With your wrong hand? | 13:37.29 |
kens | HenryStiles : I agree wiht Robin, get a car | 13:37.34 |
Robin_Watts | jogux: Henry is enough of a mad keen biker than he'd cope with the roads. Don't think Sabrina would though. | 13:38.13 |
kens | Even with the problems of driving on the other side of the road, my experience of public transport in the Lakes is that the trains are OK (but infrequent, and don't go many really good places) and buses are useless | 13:38.43 |
Robin_Watts | You can hire automatics, just make sure you specify that in advance. | 13:38.43 |
kens | Indeed | 13:38.57 |
jogux | cope, probably - enjoy, unlikely. mixing with cars doing 60mph on single track roads that then sit right on your arse and overtake into incoming traffic is not my idea of fun. | 13:39.14 |
Robin_Watts | jogux: No, HenryStiles is a speed demon. He'd be overtaking the cars :) | 13:39.50 |
jogux | I reckon I need to go cycling with Henry sometime :) | 13:40.09 |
Robin_Watts | jogux: And he lives at elevation, so our air is nice and thick. | 13:40.36 |
HenryStiles | Plan to do a lot of trail running this trip, not biking. | 13:41.06 |
Robin_Watts | You *could* possibly fly from Heathrow to Manchester, and cut out 3+ hours driving, but by the time you've checked in/out, you're not saving much. | 13:42.06 |
jogux | HenryStiles: Have you figured out which parts of Lake District you want to visit? | 13:45.11 |
HenryStiles | sabrina is going back and forth with where to stay, ambleside looks like a good candidate now. | 13:46.26 |
Robin_Watts | Bom de bom de bom de bom. | 13:47.14 |
| Oh, no, that's Ambridge. | 13:47.22 |
jogux | HenryStiles: Well doing that on the train you're looking at a getting into London and changing, a mainline train (or two), a local train then a local bus. If the timing works out okay certainly doable but not sure I'd recommend. | 13:52.17 |
| HenryStiles: Google maps works fairly well for public transport directions in the UK btw. | 13:52.51 |
| Apple maps I would not recommend trying :-) | 13:53.06 |
HenryStiles | yeah you guys have sold me on the car. | 13:53.11 |
jogux | car certainly gives you a lot more chance to explore | 13:53.45 |
kens | I thnk you can get a bus direct to the Lakes from Heathrow (National Express), but I still wouldn't recommend it | 13:53.56 |
HenryStiles | jogux: next may (2017) I'm riding with a few friends from London to Brussels. If you want to do a leg with us you are welcome, touring speeds about 75 miles a day. | 14:07.24 |
jogux | crikey. tempting. I don't know if I'm up to that. What route do you go? | 14:08.35 |
kens | You've got a year to get up to it :-) | 14:08.56 |
HenryStiles | London, dover, calais, bruges, brussels 225 miles but you can just do one or two legs if you want. | 14:09.53 |
Robin_Watts | bikes are easier with 2 legs. | 14:10.44 |
HenryStiles | :-) | 14:11.06 |
| in other random news, my son Hal is about 60 miles from the center of the japan earthquake said he hardly felt anything. | 14:14.53 |
Robin_Watts | I hadn't heard about that. Glad he's OK. | 14:19.26 |
mvrhel_laptop | tor8: thanks for the comments in the branch. I will get this fixed up today | 14:20.29 |
| hopefully we eventually will get to a point where my writing code won't require so much work for you ;) | 14:21.09 |
jogux | HenryStiles: gosh. good. | 14:34.38 |
Robin_Watts | tor8: Updated commits on robin/master that show the display list images working. It's hacked in horribly though; need to think about the API for it a bit. | 14:43.59 |
| Going to have a quick look at some gs stuff. | 14:44.08 |
rayjj | Robin_Watts: I see that marcosw dumped Bug 696703 on your lap. | 15:09.20 |
| Robin_Watts: what does display list images do for mupdf ? | 15:09.37 |
Robin_Watts | rayjj: It's so we can represent things like SVG files as images within an html document. | 15:10.17 |
| We produce a display list from the SVG file, and then package that as an fz_image. | 15:10.43 |
| Then renderers (like the draw device) can ask for versions of that at required sizes, so it always looks sharp. | 15:11.26 |
| That handles caching etc too. | 15:11.32 |
rayjj | Robin_Watts: so a fz_image isn't a pixmap (as in a PDF or PS "image") but is just an area to be drawn? | 15:12.39 |
| more like a canvas ? | 15:13.11 |
Robin_Watts | rayjj: An fz_image is an object representing an image, from which things can request a rendered pixmap. | 15:13.27 |
| (They can also request the underlying compressed data for some formats too). | 15:13.53 |
| Think of an fz_image as being a package of the underlying data for an image, plus a routine to call to decode it. | 15:14.36 |
| In gs, we pass "image_data" across the device interface, so devices can obtain the decoded data in lines. | 15:17.32 |
| In MuPDF we pass "fz_image" across the device interface, and devices can either obtain the decoded data from that (either the whole thing, or subregions), and they can ask for the underlying data too (for some formats). | 15:18.27 |
rayjj | Robin_Watts: but a fz_image display list has vector graphics (lines, fills, etc.), not just a pixmap? (more like a gs clist) | 15:26.26 |
Robin_Watts | fz_image is a derived class. | 15:26.56 |
| fz_compressed_image are images like jpg or tiff or bmp that have compressed data, and just decode to a pixmap. | 15:27.24 |
| fz_decoded_image are images that are literally a ready decoded pixmap. | 15:27.41 |
| fz_display_list_image has a display_list in it (so, with paths, text, other images, etc). | 15:28.10 |
| fz_display_list is our clist equivalent. | 15:28.24 |
rayjj | Robin_Watts: ok, I phrased the question poorly, but I was asking about the fz_display_list_image | 15:29.49 |
Robin_Watts | rayjj: I vaguely understood, but was struggling to be as clear as possible. Yes, the fz_display_list_image contains vector graphics, text, other images etc. | 15:30.55 |
| The nice thing is that as we zoom the html document in and out, the display list image can rerender itself ensuring that we get device resolution renderings every time, without having to resort to scaling. | 15:31.46 |
rayjj | Robin_Watts: OK. Thanks. I was making sure I understood your original comment "renderers (like the draw device) can ask for versions of that at required sizes, so it always looks sharp." | 15:32.17 |
| the gs term "image" is not that at all, but just a pixmap | 15:32.52 |
Robin_Watts | The main use case for this is epub, where covers/diagrams etc are all SVG. | 15:33.08 |
| Yes. In mupdf, consumers can generally think of images as being pixmaps (or things they get a pixmap from, at least). "Pixmap factories" in java speak, I think. | 15:33.53 |
rayjj | no hablo java_speak :-) | 15:34.16 |
Robin_Watts | Hmm. To profile gs with very sleepy, I'm having to do a DLL-less build. | 15:41.22 |
kens | Really ? I don't have to do that..... | 15:41.38 |
Robin_Watts | It won't find the symbols otherwise. | 15:46.04 |
kens | strange, it works for me | 15:46.20 |
Robin_Watts | According to very sleepy, on the customers file, 60% of the time is in chunk_locate_ptr | 15:54.55 |
| 95% of the time overall is in gs_stroke_path_only_aux | 15:55.57 |
| 60% is in free_path_segments_local | 15:56.23 |
mvrhel_laptop | Robin_Watts: how does rendering time for this file compare for gs vs mupdf | 15:58.03 |
Robin_Watts | I haven't let it run to completion on gs yet :) | 15:58.33 |
mvrhel_laptop | just curious | 15:58.46 |
Robin_Watts | Most of the time is spent running backwards and forwards looking for what chunk stuff is in. | 16:10.14 |
| So we flatten the incoming strokes into lines. For each line we form (allocate) a load of line segments, we fill those line segments, then free them. | 16:13.58 |
| The allocation/freeing is the hugest part of the profile. | 16:14.12 |
| I wonder if I can have a cache of them. | 16:14.26 |
| or a "pool" rather. | 16:14.37 |
mvrhel_laptop | Robin_Watts: can I ask you what is probably a very simple question | 16:16.08 |
Robin_Watts | Sure. I can't promise that the answer will be similarly simple :) | 16:16.33 |
mvrhel_laptop | well there is always that danger | 16:16.44 |
| so I have an allocation in mupdf that I do. Later I have a call to pdf_new_indirect which I see does an allocation and can throw. I had wrapped that up in a try so that if it throws I can clean up my earlier allocation | 16:17.48 |
| is that not correct? | 16:17.53 |
Robin_Watts | Sounds plausible. | 16:18.18 |
| Can I look at the code? | 16:18.21 |
mvrhel_laptop | Yes. See http://git.ghostscript.com/?p=user/tor/mupdf.git;a=commit;h=b2893533ab7fde3cb5b7322c71d72934bc83fde0 | 16:18.42 |
| in pdf-graft.c | 16:18.51 |
| diff | 16:18.53 |
| oh I see | 16:19.13 |
Robin_Watts | Is this the first bit ? | 16:19.16 |
mvrhel_laptop | no the second bit | 16:19.23 |
| he is doing a return on the call to pdf_new_indirect | 16:19.45 |
| I am still a little confused though about it | 16:20.15 |
| if the throw occurs, my allocation would not be freed if it occurred | 16:20.34 |
Robin_Watts | Me too. I need to see more context. | 16:20.38 |
mvrhel_laptop | so, in the original code, the graft_map may be handed in or it could be allocated if it had not been | 16:21.37 |
| hence the | 16:21.45 |
| if (map == NULL) | 16:21.50 |
| drop_map = map = pdf_new_graft_map(ctx, src); | 16:21.51 |
| so it is possible that we did that allocation | 16:21.58 |
| drop_map is set only if we did the allocation | 16:22.46 |
Robin_Watts | http://git.ghostscript.com/?p=user/mvrhel/mupdf.git;a=blob;f=source/pdf/pdf-graft.c;h=73dbf2cc6ce6acf6b44e684c093d660871b46378;hb=refs/heads/graft | 16:22.56 |
| Line 73ish, right? | 16:23.03 |
mvrhel_laptop | yes | 16:23.10 |
Robin_Watts | In the case where everything works, nothing drops graft_map. | 16:23.20 |
mvrhel_laptop | right | 16:23.28 |
Robin_Watts | Surely that's a leak ? | 16:23.46 |
mvrhel_laptop | hmm That could only occur if we were starting out with an indirect object as our first object as a source. I don't think that is possible | 16:24.35 |
Robin_Watts | tor8s suggestion is to do int blah = map->dst_from_source[src_num] | 16:25.28 |
| then drop the map. | 16:25.34 |
| At that point, you can call pdf_new_indirect(ctx, dst, blah, 0); and there is no cleanup required. | 16:26.02 |
mvrhel_laptop | oh yes. ok that should be fine. I should have looked more closely | 16:26.29 |
Robin_Watts | No harm, no foul. | 16:27.17 |
mvrhel_laptop | sorry about bothering with you on this. I am a little slow at times | 16:27.21 |
Robin_Watts | Not at all. it's a different scheme to gs :) | 16:27.35 |
mvrhel_laptop | one more question | 16:27.39 |
| so if I just have a single allocation and a throw occurs, and I have nothing to clean up, I dont have to fool with try, always, catch as it will just jump to what ever the last caller is on the stack that can catch it | 16:28.42 |
| Robin_Watts: think I was over using try/catch a bit more than I needed for cases like that | 16:30.20 |
Robin_Watts | Exactly. | 16:30.30 |
| try/catch is only required if you want to do something on the catch other than rethrow :) | 16:30.50 |
mvrhel_laptop | Robin_Watts: and if I do catch and I don't want to exit the code "normally" I should rethrow | 16:31.27 |
| to allow the next catch to occur | 16:31.37 |
Robin_Watts | If you don't 'rethrow' then the error is effectively swallowed. | 16:31.49 |
mvrhel_laptop | and we continue as if it had not occurred (following the code after the catch) | 16:32.10 |
Robin_Watts | (well, you could 'throw' too). | 16:32.12 |
| Yes, if you drop out of the catch it just carries on. | 16:32.22 |
mvrhel_laptop | Robin_Watts: so throw or rethrow | 16:32.52 |
Robin_Watts | yeah. | 16:32.58 |
| throw, rethrow, or conceptually "swallow". | 16:33.29 |
mvrhel_laptop | alright. I think I have a handle on this now | 16:33.49 |
| thanks for the preschool lesson ;) | 16:34.00 |
Robin_Watts | np. Tor and I bashed the macros into shape, so we have a good idea what they do. | 16:36.05 |
mvrhel_laptop | oh I see what tor has suggested. He cleverly eliminated all my indirect tests by doing a recursive call after we remove the indirection | 16:50.32 |
Robin_Watts | Is the indirect elimination done at the top of the function? | 16:52.05 |
mvrhel_laptop | yes | 16:52.10 |
Robin_Watts | Then, do you need to recurse? | 16:52.22 |
mvrhel_laptop | well it is indirect, we resolve it and then do the graft call on the resolved object | 16:52.52 |
| which will then go on to handle the dict entries or array entries etc | 16:53.11 |
| He is the one who said to recurse | 16:53.35 |
Robin_Watts | Lots of our functions are of the form: function(obj) { RESOLVE(obj); /* Do stuff with obj in the knowledge that it's not indirect */ } | 16:54.26 |
| It sounds like tor was suggesting: function(obj) { if (obj) { function(resolve(obj)); } else {... } } | 16:55.21 |
mvrhel_laptop | well we have to add the indirection number to our map, so that we will catch it if we run into it again | 16:55.56 |
| and just return the map indirection number | 16:56.12 |
Robin_Watts | I'll shut up. | 16:56.39 |
mvrhel_laptop | its all good. You have a way of often finding problems and simplifying | 16:57.13 |
rayjj | marcosw: If I understand what you proposed as your "fix" for bug 696704, it will only work for an odd number of pages in the document | 20:56.39 |
| marcosw: I found out why ps2write was not causing the page eject automatically and why psmono was, and posted a change they can make to their stuff that will make ps2write work | 20:58.02 |
| marcosw: it _does_ rely on their PS printer properly causing device deactivation with an empty dict passed to setpagedevice, but that's what Adobe PS does | 20:59.29 |
| (and ghostscript, of course) | 20:59.42 |
| mvrhel_laptop: do you know how to get VS to show a call stack when opening a "mini dump" (.dmp) file ? | 21:11.13 |
mvrhel_laptop | hi rayjj | 21:51.51 |
| I have never opened (or had) a dmp file | 21:52.05 |
ray_pc | mvrhel_laptop: sorry I wasn't paying attention. A user attached a 73Mb "Mini dump" (that's what VS calls it, but it doesn't seem very "mini" to me), but we don't really need it | 23:02.20 |
| since the crash is reproducible | 23:02.32 |
mvrhel_laptop | ha. no that is not mini | 23:02.36 |
ray_pc | to Windows users, it probably seems small ;-) | 23:03.13 |
mvrhel_laptop | ray_pc: that is true | 23:09.43 |
| tor8: for the logs, I have updated my graft branch if you want to review. After your comments the code is greatly simplified. Thanks | 23:53.08 |
| Done for the day now | 23:53.20 |
| Forward 1 day (to 2016/04/16)>>> | |