Saturday, December 27, 2008

MSDN Deployment forum

In the MFC 6 installer, it was easy to register a DirectShow filter (foo.ax): you added a COM object in Associations view, specified the CLSID, and if you also specified Context = vsiccInProcServer32 and DefInProcType = emdhServer, a wonderful thing happened: if the filter was already registered by a different application, the new installation would increment a reference count somewhere, so that uninstalling the new application wouldn't remove the filter. Very cool.

I can't figure out how to make this happen in the 2005/2008 .NET installer. The Associations view is gone, replaced by the File Types editor, which doesn't do COM objects, just file associations. The only way I've found to install a DirectShow filter at all is by using Register = vsdrfCOMSelfReg, but this approach doesn't handle sharing: uninstalling the application removes the filter unconditionally, even if previously installed applications depend on it. I tried setting SharedLegacyFile = True but it didn't work. Not good! What to do?

Tuesday, December 16, 2008

restoring app also restores iconic tool dialogs


void CToolDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
// When an iconic app is restored, by default any iconic modeless dialogs
// it owns are also restored. Clobbering their iconic states clutters the
// screen, and violates the expectation that a restored app should appear
// just as it did when it was minimized. The workaround is to skip CWnd's
// behavior in this case, and rely on the main frame to hide and show any
// iconic modeless dialogs.
if (nStatus && IsIconic()) // if parent opening/closing and we're iconic
return; // do nothing
CPersistDlg::OnShowWindow(bShow, nStatus);
}

Thanks:
Kevin
Jim
Walter
Andy
Katya

restoring minimized window position

In CPersist::LoadWnd, before SetWindowPlacement, add:

if (!(Options & NO_MINIMIZE))
wp.flags = WPF_SETMINPOSITION;

Possibly the reason this isn't enabled by default is because if the screen resolution is reduced after exiting the application, the next time the application runs, minimized windows that would otherwise be off-screen are moved to the top left corner of the screen.

Saturday, December 13, 2008

strips

Alpha version: deep zoom render that normally takes 1546 secs on CHRISK took 41 secs using the standard list of 24 Z machines, a factor of 37.7 times faster.

Compression: would help but only a little, typical ratios using pkzip were between 50% and 70%.

Wednesday, November 26, 2008

GMP 4.2.4

Tried it, the lib_gmp_p4 variant is still slower than my 4.1.2 static p4 version, e.g. 50 secs instead of 42 secs. Core 2 support won't load, it's 64-bit only. Gladman offered some suggestions but not much real help. Probably the best solution is a 64-bit version.

Monday, November 24, 2008

deep zoom 2^316 movie

It's finally done after 500 hours of elapsed time (times an average of 15 to 20 computers, mostly dual core, for something like 15,000 hours of CPU time). It diverges from the metafis YouTube movie around frame 8497. Why? Maybe his coordinates were slightly rounded? A reliable deep zoom calibration image would be handy right about now. 11/26 OK his coordinates were slightly off, definitely. Only frames 8000-end need to be rerendered though,

Sunday, November 16, 2008

source dependencies

gmp: folder at same level as project folder, containing lib and h
DX81: include and lib folders must be added to Visual Studio
htmlhelp: include and lib folders must be added to Visual Studio

Thursday, November 6, 2008

clipboard crash

new
zoom
cut 1st item
paste twice (appending)
zoom again
select all but latest snap
delete
undo all and app crashes

Monday, October 20, 2008

deep zoom

64 x 48, 4096, 1x, deep zoom On eng-ckorda: ~5 secs per frame, ~640 pixels per second, or 1.56 ms per pixel.

Wednesday, October 15, 2008

firewall headaches

Server should allow port to be specified, via command line arg.
Also need arg that specifies whether to install UDP server or not; this helps with vista firewall because even if you have a group policy exception for the TCP port, the UDP port will still trigger the firewall and cause the server to be blocked anyway.

In Vista, sometimes you have to rip the entries manually and then reboot to get the firewall to forget about a program. Firewall entries live here:
HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules

pipes versus sockets

On Z net:
pipes (one way transfer 4K packets): 18 MB per sec
sockets (client sends small, receives big): 20 MB per sec

LAN performance check:
lPerf
QCheck

Thursday, April 24, 2008

Comparision of NET2005 to MFC6

machine: eng-azhurav64
MFC6 36.27
NET2005 39.14 and that's with SSE2! WTF?
NET2005 without progress bar: 38.9 so it's not that...

machine: eng-ckorda
MFC6 40.50
NET2005 43.97 with SSE2, FP = fast
NET2005 45.90 with SSE2, FP = precise
NET2005 38.05 SSE disabled, FP = fast
NET2005 36.78 SSE disabled, FP = precise <-- fastest!!!

Looks like SSE2 is SLOWER than the FPU for the rendering loop.
Need to hand-code it and process two pixels at once!

deep zoom benchmark (same coords but 640 x 480, 1x)
machine: eng-ckorda
MFC6 253.27
NET2005 213.03 significantly faster

eng-sfreed: 1024x768, 4096, 4x, GMP = 49 minutes... that's 30 max frames per day

Thursday, April 17, 2008

GmpBench

coordinates: deep zoom +132 (768 bits).frs
checksum: 24454011
------------------------
machine: ckci-home (Pentium III)
compiler: VC++ 6.0
GMP version: 4.1.2
GMP target: P6
GmpBench: 446.96
Fractice: 445.71

machine: eng-ckorda (2.66 GHz Intel CoreDuo)
compiler: VC++ 6.0
GMP version: 4.1.2 (my port)
GMP target: Pentium4
GmpBench: 106.02, 105.86

machine: eng-ckorda (2.66 GHz Intel CoreDuo)
compiler: .NET 2005
GMP version: 4.1.2 (my port)
GMP target: Pentium4
GmpBench: 105.25, 105.33

machine: eng-ckorda (2.66 GHz Intel CoreDuo)
compiler: .NET 2005
GMP version: 4.2.2 (Gladman's port)
GMP target: Pentium4
GmpBench: 111.29, 111.34

Many differences between Gladman's 4.2 and my 4.1, likely candidates include
config.h (alloc differences!)
gmp-mparams.h
gmp-impl.h
longlong.h (long long is enabled in Gladman but not mine)

Wednesday, April 16, 2008

GMP assembler port

benchmark
pc: z / eng-ckorda
file: deep zoom +136 (768 bits).frs
bits: 768

ASM pass1 pass2
---- ----- -----
generic 173.6 174.3
x86 66.7 65.9
P6 60.0 61.0
P4 59.0 59.0
.NET 71.0 71.0

x86 gives a huge gain, nearly 3x faster!!
p6 is probably worth it, but p4 not
.NET is slower? WTF?

Monday, April 14, 2008

HPAlib test results

default
HPA 6.741
GMP 15.267

deep zoom to +23.frs
HPA 86
GMP 224

Conclusion:
HPA is between 2 and 2.6 times faster than GMP. Unfortunately it runs out of precision at around +32, so it's not much of an improvement over the FPU.

Saturday, March 15, 2008

interesting palettes

matisse.bonheur-vivre.pal
muted rainbow

Friday, March 14, 2008

DIB versus DDB for thumbnails

Benchmarks show a DDB is 1.2 times slower on the StretchBlt in CreateThumb, and up to 10 times slower in the history view's OnDraw. Yes there's a penalty for converting to DIB in the serialize function, and yes it uses a bit more memory (32 vs 24 bit) but it's worth it.