Recent Posts

Pages: [1] 2 3 ... 10
1
The Laboratory / Re: What is the fastest C/C++ compiler
« Last post by AW on Today at 06:59:54 PM »
MSVC and Intel compilers can also do Profile Guided Optimization which can boost performance in a large program. However, on small programs it can even have adverse effects. Still, I made a small test with the MSVC on my demos, results were inconclusive for the 64-bit but I noticed a little improvement of almost 5% for the 32-bit.
2
The Laboratory / Re: Benchmark (for assemblers and compilers)
« Last post by TimoVJL on Today at 06:46:05 PM »
Reason for that was a missing UTF-8 BOM from source file, so compilers handle differently source file without it.
Test files updated.

msvc have an option /utf-8 for bypassing that.

Which is still over a factor 2 slower than assembly, though ;)
Good for you  ;)
3
The Workshop / Re: Challenge: Insert .PNG from resource into Richedit
« Last post by AW on Today at 06:28:16 PM »
How do i control unicode character colors in richedit? Maybe that would be able todo it a 3rd way ala full zoomed in picture in paint,where the pixels are very big
Unicode color characters are not the scope of this, but I read that color can be changed. It is state of the art developments, badly documented by the Microsoft guys, in order to keep a lead and maintain their jobs (*). So, I have not looked at it.
Here, .PNGs can be resized and, in theory, they can also be processed, namely to change color, before rendering. But I am not seeing any interesting scenario for that.

(*) As we know, the Richedit control is also a big mess, poorly documented and full of black art trickery. Probably, this is the reason Mr. M.S has kept his job for so long.
Anyway, the Richedit comes free with the OS, what are we complaining about?
4
Good investigation LiaoMi, although I had no success pursuing the leads.  :(
Amazon has announcements for the book in New condition although expensive for something so dated. I am out.  :biggrin:
5
How do i control unicode character colors in richedit? Maybe that would be able todo it a 3rd way ala full zoomed in picture in paint,where the pixels are very big

6
https://www.betaarchive.com/forum/viewtopic.php?f=16&t=15317

Unfortunately I did not achieve success with these betaarchive guys ... and KarlG just banned me on his website .. Although there is a second KarlG, but it seems to me that this is definitely not the one we need.
KarlG 1 - https://cncwerk.de/forum/viewforum.php?f=2
KarlG 2 - https://www.kguttag.com/about-karl-guttag/

I haven’t written to the second Karl!  :biggrin:
7
The Workshop / Challenge: Insert .PNG from resource into Richedit
« Last post by AW on Today at 08:11:00 AM »
This is a demo based in this Murray Sargent article.
It inserts .PNGs into a Richedit control.
Previous Richedit controls support the insertion of .BMP images. Although the procedure for that is much more complicated, .BMPs  do not support as well the alpha channel which  means that images look bad when the background does not match the parent background.



I will provide the source code for this when someone posts something equivalent. If not, I will post the source code in about 1 month time.
8
The Laboratory / Re: Benchmark (for assemblers and compilers)
« Last post by jj2007 on Today at 08:08:13 AM »
Yes, a pointless test.

Because UTF8 behaves exactly like plain ANSI: a sequence of bytes. On my machine, gcc8_64 wins this test (attention, some return "found 0"):
Code: [Select]
TestLoadFileChClang8_64.exe
load: 2ms
process: 7ms, found 76
total: 9ms

TestLoadFileChmsvc.exe
load: 2ms
process: 8ms, found 0
total: 10ms

TestLoadFileChmsvcX64.exe
load: 2ms
process: 7ms, found 0
total: 10ms

TestLoadFileChgcc8X64.exe
load: 2ms
process: 4ms, found 76
total: 7ms

DSVRead_Test1gcc8_64.exe
load: 2ms
process: 4ms, found 76
total: 7ms

TestLoadFileChpocc8.exe
load: 2ms
process: 6ms, found 0
total: 8ms

TestLoadFileChpocc9.exe
load: 2ms
process: 10ms, found 0
total: 13ms

TestLoadFileChpocc864.exe
load: 3ms
process: 6ms, found 0
total: 9ms

TestLoadFileChpocc964.exe
load: 2ms
process: 7ms, found 0
total: 10ms

Which is still over a factor 2 slower than assembly, though ;)
9
The Laboratory / Re: Benchmark (for assemblers and compilers)
« Last post by TimoVJL on Today at 06:51:00 AM »
Yes, a pointless test.
The winner was gcc 8.2 x64
Code: [Select]
load: 5ms
process: 5ms, found 76
total: 11ms
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifdef USE_MALLOC
#include <stdlib.h>
#endif
#pragma comment(lib, "kernel32.lib")

int __cdecl main(int argc, char **argv)
{
LONGLONG freq, t1, t2, t3;
HANDLE hFile;
QueryPerformanceFrequency((LARGE_INTEGER *) & freq);
QueryPerformanceCounter((LARGE_INTEGER*)&t1);
if ((hFile = CreateFile("chinese.txt", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL)) == INVALID_HANDLE_VALUE)
return 1;
DWORD nRead, nMax;
nMax = GetFileSize(hFile, NULL);
#ifdef USE_MALLOC
char *pFile = malloc(nMax + 1); // malloc buffer
*(pFile + nMax) = 0; // EOF marker
#else
HANDLE hHeap = GetProcessHeap();
char *pFile = HeapAlloc(hHeap, HEAP_ZERO_MEMORY, nMax + 1);
#endif
ReadFile(hFile, pFile, nMax, &nRead, NULL);
CloseHandle(hFile);
if (nRead != nMax) return 2;
QueryPerformanceCounter((LARGE_INTEGER*)&t2);
char *pc = pFile;
char *pKey = u8"神 說";
int nFound = 0;
char *pcs = pKey;
while(*pc) {
while(*pc) {
if (*pc++ != *pcs) {
if (!*pcs) // end of search string
nFound++;
pcs = pKey; // reset search
break;
} else pcs++;
}
}
QueryPerformanceCounter((LARGE_INTEGER*)&t3);
printf("load: %dms\n", (int)((t2-t1) * 1000 / freq));
printf("process: %dms, found %d\n", (int)((t3-t2) * 1000 / freq), nFound);
printf("total: %dms\n", (int)((t3-t1) * 1000 / freq));
return 0;
}
10
The Laboratory / Re: Benchmark (for assemblers and compilers)
« Last post by jj2007 on Today at 05:55:00 AM »
Pretty big differences, astonishing.
Code: [Select]
TestLoadFileChClang8_64.exe
load: 7ms
process: 14ms, found 76
total: 24ms

TestLoadFileChmsvcX64.exe
load: 2ms
process: 8ms, found 76
total: 12ms

TestLoadFileChpocc8.exe
load: 2ms
process: 12ms, found 76
total: 16ms

TestLoadFileChpocc9.exe
load: 2ms
process: 10ms, found 76
total: 14ms

TestLoadFileChpocc864.exe
load: 2ms
process: 8ms, found 76
total: 11ms

TestLoadFileChpocc964.exe
load: 2ms
process: 8ms, found 76
total: 12ms
Pages: [1] 2 3 ... 10