Welcome, Guest. Please login or register.

Author Topic: NetSurf OS3.x Issues  (Read 40994 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline chris

Re: NetSurf OS3.x Issues
« Reply #239 from previous page: February 29, 2016, 12:50:04 AM »
Leap day treat: I've managed to get NetSurf compiling with optimisations enabled!
It doesn't provide much noticeable speed-up (most of the heavy processing happens in the libraries which were already built with optimisations on) and Javascript still doesn't work (fatal error on launch).

Usual place, built with optimisations but without Javascript, for testing.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline wawrzon

Re: NetSurf OS3.x Issues
« Reply #240 on: February 29, 2016, 01:31:16 AM »
Quote from: chris;804837
It doesn't provide much noticeable speed-up (most of the heavy processing happens in the libraries which were already built with optimisations on)


as mentined also, the compiler optimizations usually are a bit overrated, there isnt that much to expect of it, maybe 20-30% at most.
« Last Edit: February 29, 2016, 11:18:24 AM by wawrzon »
 

Offline olsen

Re: NetSurf OS3.x Issues
« Reply #241 on: February 29, 2016, 08:38:55 AM »
Quote from: itix;804810
I would just take a shortcut and install TSLFmem: http://dump.platon42.de/files/

Other than that, there is no really solution. Designing good memory allocator is an art of its own where one has to consider memory fragmentation, allocation performance and deallocation performance.
All true... but given the limited scalability of the built-in AmigaOS 68k memory management system, it's worth a try looking for alternatives. What's the worst that could happen?

Quote
Yeah, I read from previous page that with TLSFmem Netsurf is crashing but this is very likely due to internal memory trash somewhere in Netsurf... with good old memory lists and standard memory pools buffer under/overflows often go unnoticed but with TLSF you are likely going to crash right away.

Of course, Wipeout session could reveal this albeit it is going to be painfully slow experience with such a complex application.
One could do what Wipeout does directly within the application itself. There exist wrappers for the entire malloc()/alloca()/realloc()/free() family which hook into a tracking system which verifies consistency and also keeps score of where the allocations were made from (with file name and line number), etc. You could even build your own system if you wanted to (I did with Wipeout - this isn't so hard, really).

Wipeout is several layers removed from the application performing the memory allocations and will provide little information to go on. It's a system-wide debugging aid, whereas here you would be better served by an application-specific solution.

Update: I looked around a bit and found the Boehm garbage collector (http://hboehm.info/gc/) which can be used as a drop-in for the malloc(), etc. family. Might be worth a shot. Debug wrappers for the malloc(), etc. family exist in several flavours, e.g. http://dmalloc.com or http://www.hexco.de/rmdebug/. Some assembly may be required.
« Last Edit: February 29, 2016, 01:07:15 PM by olsen »
 

Offline utri007

Re: NetSurf OS3.x Issues
« Reply #242 on: February 29, 2016, 12:50:24 PM »
Tested

Install script doesn't work, it says it requires OS4 system.

First this one seems to be fast, with my 060 it loads amiga.org front page 18sec and with 040 takes 25 sec.

Sounds very useable at this point, but ...

Second page (amiga.org forums) loads also fast, but third page (amiga.org front page) loads 88 seconds and fourth page (forums) gives time out and this time RoadShow dies.

Just to note, when I installed / configured roadshow I put 8x more buffres than default. Default is 32, now there is 256 buffers. I did that test AmiTCP also, but I ques current install has only 32 buffers. This made noticeable diffrence with AmiTCP.

There is something wrong in my users/choises file on my 060 amiga. Netsurf doesn't load it and displays wrong colors, need to test that more.
ACube Sam 440ep Flex 800mhz, 1gb ram and 240gb hd and OS4.1FE
A1200 Micronic tower, OS3.9, Apollo 060 66mhz, xPert Merlin, Delfina Lite and Micronic Scandy, 500Gb hd, 66mb ram, DVD-burner and WLAN.
A1200 desktop, OS3.9, Blizzard 060 66mhz, 66mb ram, Ide Fix Express with 160Gb HD and WLAN
A500 OS2.1, GVP+HD8 with 4mb ram, 1mb chip ram and 4gb HD
Commodore CDTV KS3.1, 1mb chip, 4mb fast ram and IDE HD
 

Offline olsen

Re: NetSurf OS3.x Issues
« Reply #243 on: February 29, 2016, 01:21:01 PM »
Quote from: kamelito;804817
@Olsen
Lists, this remind me of this : https://isocpp.org/blog/2014/06/stroustrup-lists

Kamelito
As always, he has a point :)

The memory management system in AmigaOS 68k is, in my opinion, adequate for the type of machine it was intended for when the system was designed. It's fast and managing free space is efficient, too, for small amounts of memory (say, 256 KBytes to tens of MBytes). Because it is built around doubly-linked lists it's easy to understand how it works, which is a big bonus in this field. These properties seem to be a good match for Stroustrup's view on the matter.

Unfortunately, a simple and robust memory management system is still simple and while it may have held up well for more than 30 years in its domain, the design could not anticipate the needs of a web browser, which is likely one of the most complex systems ever designed  ;)
 

Offline olsen

Re: NetSurf OS3.x Issues
« Reply #244 on: February 29, 2016, 01:33:20 PM »
Quote from: chris;804828
Hi Olaf, thanks for commenting.  I increased the puddle size to 16K from the default 4K and it seems to have helped in my limited testing (no feedback yet from anybody else).  I figure this reduces the number of puddles in the list which need to be searched through, as well as allowing larger allocations into the pool.
It might help, but you will have to put up with the limitations of the list-based memory management system if you stick with the pools.

As I mentioned before, you might want to cast a bigger net for alternative memory management solutions. No matter how much you tweak the puddle size, there will be side-effects which are just as strange as the ones you hope to get under better control (fragmentation, number of items in each list that need to be checked, etc.). Hence, I would suggest you look into finding a memory management system which can be tuned to the needs of the application.


Quote
I haven't.  I think there are cache statistics in the log which might offer some clues though.  Beyond the cache data everything else is structures which should all be very small.
Well, you can't get a good handle on the memory problem until you have enough data to permit you to make a decision on how to proceed.

For example, you could collect information on the average sizes of allocations made and then group them. Let's say you have one group of 128 bytes or less, one of 256 bytes or less, up to 4KBytes or less and then everything else. You could set up different pools from which only these specific allocation sizes would be drawn. For best effect match the puddle sizes to the most frequently used allocation sizes.

Another idea would be to recycle memory allocations once they are freed. Again, you would group allocations by size (128 bytes or less, 256 bytes or less, etc.) and once an allocation is freed, you'd stick it into a list of chunks of the same size available for reuse. If an allocation is made which matches the chunk size of an entry in the list, you'd pick up the first entry and reuse it. That saves effort because you don't have to merge allocations back into bigger chunks upon freeing them, and because you don't have to search for allocations inside the fragmented puddles: you just pick up the first entry in the respective list, remove it from the list and the use it. Mind you, you will have to watch how much memory is tied up in these lists and prune them to avoid running out of memory over time.
« Last Edit: February 29, 2016, 01:44:35 PM by olsen »
 

Offline olsen

Re: NetSurf OS3.x Issues
« Reply #245 on: February 29, 2016, 01:42:33 PM »
Quote from: wawrzon;804834
thanks for confirmation olaf. this is ecxactly what i had in mind. however designing application specific memory allocator oer allocation method is probably not the right way..
Sometimes it's the only option to regain control over how the application uses the memory if how it is used is a poor match for the abilities of the operating system.

An extreme example may be the BSD-Unix derived TCP/IP stacks for the Amiga which all retain the source kernel's memory management system, which is fused with the TCP segment reassembly logic. This code sits atop the Amiga memory management system, where it emulates the 2K memory pages of the Unix system it was originally designed for.

I have used simpler custom memory management code in my own server applications, e.g. by directly recycling freed memory chunks instead of delegating the work to the operating system and the 'C' link library that sits on top of it. I helped to keep long term fragmentation of memory at bay.

All of these are perfectly legitimate solutions :)
 

Offline utri007

Re: NetSurf OS3.x Issues
« Reply #246 on: February 29, 2016, 03:22:16 PM »
Made testing with WinUAE, results were quite impressive.

First, it starts but freeses if CPU is not set to 68040, no matter is FPU enabled or not.

It is very fast and no slow down at least noticeable. All the pages loads less than 5 seconds.

I got one error after I log on to this site and cliked quick reply button :

Assertion of condition

"perror == PARSEUTIL_OK"
failed in line "utils/utf8.c", line 135.
« Last Edit: February 29, 2016, 06:58:58 PM by utri007 »
ACube Sam 440ep Flex 800mhz, 1gb ram and 240gb hd and OS4.1FE
A1200 Micronic tower, OS3.9, Apollo 060 66mhz, xPert Merlin, Delfina Lite and Micronic Scandy, 500Gb hd, 66mb ram, DVD-burner and WLAN.
A1200 desktop, OS3.9, Blizzard 060 66mhz, 66mb ram, Ide Fix Express with 160Gb HD and WLAN
A500 OS2.1, GVP+HD8 with 4mb ram, 1mb chip ram and 4gb HD
Commodore CDTV KS3.1, 1mb chip, 4mb fast ram and IDE HD
 

Offline utri007

Re: NetSurf OS3.x Issues
« Reply #247 on: February 29, 2016, 10:58:38 PM »
More testing with real amiga.

user/choises file is not read anymore. So I can't enable friend_bitmap.

Amigahistory.co.uk doesn't cause any slow down, Spend quite many minits surfing that site, every page was displayed at lest 3 times. It is plain html page.
ACube Sam 440ep Flex 800mhz, 1gb ram and 240gb hd and OS4.1FE
A1200 Micronic tower, OS3.9, Apollo 060 66mhz, xPert Merlin, Delfina Lite and Micronic Scandy, 500Gb hd, 66mb ram, DVD-burner and WLAN.
A1200 desktop, OS3.9, Blizzard 060 66mhz, 66mb ram, Ide Fix Express with 160Gb HD and WLAN
A500 OS2.1, GVP+HD8 with 4mb ram, 1mb chip ram and 4gb HD
Commodore CDTV KS3.1, 1mb chip, 4mb fast ram and IDE HD
 

Offline chris

Re: NetSurf OS3.x Issues
« Reply #248 on: February 29, 2016, 11:28:13 PM »
Quote from: olsen;804900
It might help, but you will have to put up with the limitations of the list-based memory management system if you stick with the pools.


Yes... I don't really want to write my own memory management though!
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline chris

Re: NetSurf OS3.x Issues
« Reply #249 on: February 29, 2016, 11:34:05 PM »
Quote from: utri007;804892
Install script doesn't work, it says it requires OS4 system.


Make sure you don't have a file called netsurf.readme in the install source (or netsurf.readme~, which may well confuse the pattern matching)

Quote from: utri007;804925
Made testing with WinUAE, results were quite impressive.

First, it starts but freeses if CPU is not set to 68040, no matter is FPU enabled or not.


Works on an '030 here.  The freeze is probably that damn memory corruption bug.

Quote
I got one error after I log on to this site and cliked quick reply button :

Assertion of condition

"perror == PARSEUTIL_OK"
failed in line "utils/utf8.c", line 135.


I've added some code to try to protect against that, however I saw a similar assert in some random code when I tried to launch NetSurf from the Shell.  It went away if I increased the stack first, so you might want to check the stack is high enough (the stack cookie might be getting optimised away; didn't check).  Try at least 100K.

Quote from: utri007;804980
user/choises file is not read anymore. So I can't enable friend_bitmap.


It definitely does read the file.  Note it's called "Choices" and there's an extra level under Users.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline utri007

Re: NetSurf OS3.x Issues
« Reply #250 on: March 02, 2016, 06:29:20 PM »
ShK got these problems.

http://s7.postimg.org/3p3mrss3v/003.png
Installer doesn't work
http://s7.postimg.org/434yrec7f/004.png
Requires usergroup.library

His install is clean OS3.9 with Genesis
ACube Sam 440ep Flex 800mhz, 1gb ram and 240gb hd and OS4.1FE
A1200 Micronic tower, OS3.9, Apollo 060 66mhz, xPert Merlin, Delfina Lite and Micronic Scandy, 500Gb hd, 66mb ram, DVD-burner and WLAN.
A1200 desktop, OS3.9, Blizzard 060 66mhz, 66mb ram, Ide Fix Express with 160Gb HD and WLAN
A500 OS2.1, GVP+HD8 with 4mb ram, 1mb chip ram and 4gb HD
Commodore CDTV KS3.1, 1mb chip, 4mb fast ram and IDE HD
 

Offline olsen

Re: NetSurf OS3.x Issues
« Reply #251 on: March 02, 2016, 07:30:10 PM »
Quote from: chris;804983
Yes... I don't really want to write my own memory management though!
Need a hand? :)
 

Offline utri007

Re: NetSurf OS3.x Issues
« Reply #252 on: March 02, 2016, 09:47:39 PM »
Spend some time to figuring out why my choices file is not readed. Location has changed, now it is users/default/choices

I have just reinstalled it to top of previous versions.

I also tried to run TLSFmem and it doesn't crash Netsurf anymore.

It has some effect to browsing with Netsurf, but it is not a solution. It seems to make Netsurf faster generally and slow down effect comes latter.
ACube Sam 440ep Flex 800mhz, 1gb ram and 240gb hd and OS4.1FE
A1200 Micronic tower, OS3.9, Apollo 060 66mhz, xPert Merlin, Delfina Lite and Micronic Scandy, 500Gb hd, 66mb ram, DVD-burner and WLAN.
A1200 desktop, OS3.9, Blizzard 060 66mhz, 66mb ram, Ide Fix Express with 160Gb HD and WLAN
A500 OS2.1, GVP+HD8 with 4mb ram, 1mb chip ram and 4gb HD
Commodore CDTV KS3.1, 1mb chip, 4mb fast ram and IDE HD
 

Offline chris

Re: NetSurf OS3.x Issues
« Reply #253 on: March 03, 2016, 12:02:18 AM »
Quote from: utri007;805185
Installer doesn't work


Installer reads a different version number to what I thought it did.. fixed.

Quote
Requires usergroup.library


Provided by the TCP/IP stack.  You can just nick the one from the AmiTCP archive though.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline chris

Re: NetSurf OS3.x Issues
« Reply #254 on: March 03, 2016, 12:03:08 AM »
Quote from: olsen;805190
Need a hand? :)


If you want to help, then yes please!
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz